#[repr(u8)]pub enum Encoding {
None = 0,
QuotedPrintable = 1,
Base64 = 2,
}Expand description
Declared Content-Transfer-Encoding of a part. The numeric values (0, 1, 2) are stable.
Variants§
None = 0
No transfer encoding: 7bit, 8bit, binary, no field, or a value
the parser does not know.
QuotedPrintable = 1
quoted-printable.
Base64 = 2
base64.
Implementations§
Source§impl Encoding
impl Encoding
Sourcepub fn decode(self, bytes: &[u8]) -> Cow<'_, [u8]>
pub fn decode(self, bytes: &[u8]) -> Cow<'_, [u8]>
Decodes a body in this Content-Transfer-Encoding, as crate::MessagePart::decoded does.
Sourcepub fn decode_checked(self, bytes: &[u8]) -> (Cow<'_, [u8]>, bool)
pub fn decode_checked(self, bytes: &[u8]) -> (Cow<'_, [u8]>, bool)
Decodes a body like Encoding::decode and reports whether the encoding was malformed.
Sourcepub fn decode_append(self, bytes: &[u8], out: &mut Vec<u8>)
pub fn decode_append(self, bytes: &[u8], out: &mut Vec<u8>)
Decodes a body like Encoding::decode, appending the result to out.
Sourcepub fn decoded_len(self, bytes: &[u8]) -> usize
pub fn decoded_len(self, bytes: &[u8]) -> usize
Returns the length of a body after transfer decoding, as crate::MessagePart::decoded_len does.
Trait Implementations§
impl Copy for Encoding
impl Eq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnsafeUnpin for Encoding
impl UnwindSafe for Encoding
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