pub struct Directive<'a> {
pub name: &'a [u8],
pub value: Option<Word<'a>>,
}Expand description
One directive: a name and an optional argument.
§Examples
use parse_net::{cache, Limits};
let d = cache::parse(b"max-age=60", &Limits::DEFAULT)?.iter().next().expect("one directive");
assert_eq!(d.name, b"max-age");
assert!(d.value.is_some_and(|v| v.eq_bytes(b"60")));Fields§
§name: &'a [u8]The name as sent (compare it ASCII case-insensitively).
value: Option<Word<'a>>The argument, token or quoted.
Trait Implementations§
impl<'a> Copy for Directive<'a>
impl<'a> Eq for Directive<'a>
impl<'a> StructuralPartialEq for Directive<'a>
Auto Trait Implementations§
impl<'a> Freeze for Directive<'a>
impl<'a> RefUnwindSafe for Directive<'a>
impl<'a> Send for Directive<'a>
impl<'a> Sync for Directive<'a>
impl<'a> Unpin for Directive<'a>
impl<'a> UnsafeUnpin for Directive<'a>
impl<'a> UnwindSafe for Directive<'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