pub struct Fields { /* private fields */ }Expand description
Raw ordered pairs. Duplicate names, spelling, spacing, and opaque value
bytes are preserved. Interpretation belongs to an explicit header policy;
trailers are a separate BodyFrame::Headers event.
Implementations§
Source§impl Fields
impl Fields
pub fn new() -> Self
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Fields with storage for capacity pairs, for a driver that knows how
many it will add.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve storage for at least additional more pairs.
pub fn try_from_pairs<N: AsRef<str>, V: AsRef<[u8]>>( pairs: impl IntoIterator<Item = (N, V)>, ) -> Result<Self, FieldError>
pub fn pairs(&self) -> &[Field]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a
pub fn contains(&self, name: &str) -> bool
pub fn add( &mut self, name: impl AsRef<str>, value: impl AsRef<[u8]>, ) -> Result<(), FieldError>
pub fn append(&mut self, field: Field) -> Result<(), FieldError>
pub fn set( &mut self, name: impl AsRef<str>, value: impl AsRef<[u8]>, ) -> Result<(), FieldError>
pub fn remove(&mut self, name: &str) -> usize
pub fn retain(&mut self, keep: impl FnMut(&Field) -> bool)
pub fn clear(&mut self)
pub fn split_off(&mut self, at: usize) -> Self
Trait Implementations§
impl Eq for Fields
Source§impl Extend<Field> for Fields
impl Extend<Field> for Fields
Source§fn extend<T: IntoIterator<Item = Field>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Field>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Field> for Fields
impl FromIterator<Field> for Fields
Source§impl IntoIterator for Fields
impl IntoIterator for Fields
impl StructuralPartialEq for Fields
Auto Trait Implementations§
impl Freeze for Fields
impl RefUnwindSafe for Fields
impl Send for Fields
impl Sync for Fields
impl Unpin for Fields
impl UnsafeUnpin for Fields
impl UnwindSafe for Fields
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