You need to import the CookieJar
trait to access those methods.
// Create a cookie jar we can share with the HTTP client
let jar = Arc::new(Jar::default());
// create the HTTP client
let client = Client::builder()
.cookie_provider(Arc::clone(&jar))
.cookie_store(true)
.build()
.unwrap();
// Add some cookies
let cookie = HeaderValue::from_static(
"password=my_super_secret_password; Expires=Thu, 21 Oct 2021 07:28:00 GMT; Secure; HttpOnly",
);
let url = "https://example.com".parse().unwrap();
jar.set_cookies(&mut [cookie].iter(), &url);