Struct RawBody
pub struct RawBody { /* private fields */ }Expand description
Representation of a mail
Implementations§
§impl RawBody
impl RawBody
pub fn headers_lines(&self) -> impl Iterator<Item = &str>
pub fn headers_lines(&self) -> impl Iterator<Item = &str>
Return an iterator over the headers field
pub const fn raw_headers(&self) -> &Vec<String>
pub const fn raw_headers(&self) -> &Vec<String>
Get all headers without parsing.
pub fn get_header(&self, name: &str, with_key: bool) -> Option<String>
pub fn get_header(&self, name: &str, with_key: bool) -> Option<String>
Search for a header (using lowercase) and return its value.
pub fn count_header(&self, name: &str) -> usize
pub fn count_header(&self, name: &str) -> usize
Count the number of time a header is present. (using lowercase)
pub fn set_header(&mut self, name: &str, value: &str)
pub fn set_header(&mut self, name: &str, value: &str)
Set the value of a header or add it if it does not already exist.
pub fn rename_header(&mut self, old: &str, new: &str)
pub fn rename_header(&mut self, old: &str, new: &str)
Rename a header.
pub fn add_header(&mut self, name: &str, value: &str)
pub fn add_header(&mut self, name: &str, value: &str)
Append a header to the list.
pub fn prepend_header(&mut self, headers: impl IntoIterator<Item = String>)
pub fn prepend_header(&mut self, headers: impl IntoIterator<Item = String>)
Prepend a header to the list.
pub fn remove_header(&mut self, name: &str) -> bool
pub fn remove_header(&mut self, name: &str) -> bool
Remove a header from the list.
Trait Implementations§
§impl<'de> Deserialize<'de> for RawBody
impl<'de> Deserialize<'de> for RawBody
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RawBody
impl StructuralPartialEq for RawBody
Auto Trait Implementations§
impl Freeze for RawBody
impl RefUnwindSafe for RawBody
impl Send for RawBody
impl Sync for RawBody
impl Unpin for RawBody
impl UnwindSafe for RawBody
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more