Struct Body

Source
pub struct Body<'a> { /* private fields */ }
Expand description

Parsed body of an Audit message, consisting of Key/Value pairs.

Implementations§

Source§

impl Body<'_>

Source

pub fn new() -> Self

Constructs a new, empty Body.

Source

pub fn with_capacity(len: usize) -> Self

Constructs a new, empty Body with at least the specified capacity for Key/Value entries.

Source

pub fn push(&mut self, kv: (Key, Value<'_>))

Appends kv to the back of a Body.

Source

pub fn len(&self) -> usize

Returns the number of elements in the Body.

Source

pub fn extend(&mut self, other: Self)

Extends Body with the elements of another Body.

Source

pub fn is_empty(&self) -> bool

Returns true if the Body has a length of 0.

Source

pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Option<&Value<'_>>

Retrieves the first value found for a given key.

Source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements.

Source§

impl<'a> Body<'a>

Source

pub fn retain<F>(&mut self, f: F)
where F: FnMut(&(Key, Value<'a>)) -> bool,

Retains only the elements specified by the predicate.

Trait Implementations§

Source§

impl Clone for Body<'_>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Body<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Body<'_>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Body<'_>

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> IntoIterator for &'a Body<'a>

Source§

type Item = &'a (Key, Value<'a>)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, (Key, Value<'a>)>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for Body<'a>

Source§

type Item = (Key, Value<'a>)

The type of the elements being iterated over.
Source§

type IntoIter = BodyIterator<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> PartialEq for Body<'a>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Body<'_>

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Body<'a>

§

impl<'a> RefUnwindSafe for Body<'a>

§

impl<'a> Send for Body<'a>

§

impl<'a> Sync for Body<'a>

§

impl<'a> !Unpin for Body<'a>

§

impl<'a> UnwindSafe for Body<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,