Function rouille::input::cookies [−][src]
pub fn cookies(request: &Request) -> CookiesIter<'_>ⓘNotable traits for CookiesIter<'a>
impl<'a> Iterator for CookiesIter<'a> type Item = (&'a str, &'a str);
Attempts to parse the list of cookies from the request.
Returns an iterator that produces a pair of (key, value)
. If the header is missing or
malformed, an empty iterator is returned.
Example
use rouille::Request; use rouille::input; if let Some((_, val)) = input::cookies(&request).find(|&(n, _)| n == "cookie-name") { println!("Value of cookie = {:?}", val); }