pub struct Directives<'a> { /* private fields */ }Expand description
Validated directives.
§Examples
use parse_net::{cache, Limits};
let d = cache::parse(b"no-store, max-age=0", &Limits::DEFAULT)?;
assert_eq!(d.len(), 2);
assert!(d.iter().any(|x| x.name.eq_ignore_ascii_case(b"NO-STORE")));Implementations§
Source§impl<'a> Directives<'a>
impl<'a> Directives<'a>
Sourcepub fn iter(&self) -> impl Iterator<Item = Directive<'a>> + use<'a>
pub fn iter(&self) -> impl Iterator<Item = Directive<'a>> + use<'a>
The directives, in order.
§Examples
use parse_net::{cache, Limits};
let d = cache::parse(b"public, max-age=60", &Limits::DEFAULT)?;
let has_value: Vec<bool> = d.iter().map(|x| x.value.is_some()).collect();
assert_eq!(has_value, [false, true]);Trait Implementations§
Source§impl<'a> Clone for Directives<'a>
impl<'a> Clone for Directives<'a>
impl<'a> Copy for Directives<'a>
Source§impl<'a> Debug for Directives<'a>
impl<'a> Debug for Directives<'a>
impl<'a> Eq for Directives<'a>
Source§impl<'a> Hash for Directives<'a>
impl<'a> Hash for Directives<'a>
Source§impl<'a> PartialEq for Directives<'a>
impl<'a> PartialEq for Directives<'a>
impl<'a> StructuralPartialEq for Directives<'a>
Auto Trait Implementations§
impl<'a> Freeze for Directives<'a>
impl<'a> RefUnwindSafe for Directives<'a>
impl<'a> Send for Directives<'a>
impl<'a> Sync for Directives<'a>
impl<'a> Unpin for Directives<'a>
impl<'a> UnsafeUnpin for Directives<'a>
impl<'a> UnwindSafe for Directives<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more