pub struct Params { /* private fields */ }Expand description
An ordered list of parameters.
Implementations§
Source§impl Params
impl Params
Sourcepub fn push(&mut self, param: Param)
pub fn push(&mut self, param: Param)
Append a parameter, keeping any existing one of the same name.
Sourcepub fn remove(&mut self, name: &str) -> bool
pub fn remove(&mut self, name: &str) -> bool
Remove every parameter with this name, and say whether any was there.
Every one, not the first: the list preserves duplicates because a message may contain them, and leaving a second copy behind after removing the first would be a silent change of meaning rather than a removal.
Sourcepub fn get(&self, name: &str) -> Option<&Param>
pub fn get(&self, name: &str) -> Option<&Param>
The first parameter with this name, if any. Names compare case-insensitively.
Sourcepub fn value(&self, name: &str) -> Option<&[u8]>
pub fn value(&self, name: &str) -> Option<&[u8]>
The value of the first parameter with this name.
Returns None both when the parameter is absent and when it is present without a
value; use Params::contains to tell those apart, because ;lr and no lr at all
mean different things.
Trait Implementations§
Source§impl FromIterator<Param> for Params
impl FromIterator<Param> for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnsafeUnpin for Params
impl UnwindSafe for Params
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