pub enum ContentTransferEncoding {
SevenBit,
EightBit,
Binary,
}Expand description
A part’s Content-Transfer-Encoding field, limited to the identity encodings of RFC 2045 section 6, under which content is passed as it was written.
This crate does not decode content, so base64 and quoted-printable, and any other encoding, are invalid values: content in them would otherwise be read as if it were not encoded. RFC 7578 section 4.7 deprecates the field for form data.
use base_web_multipart::ContentTransferEncoding;
use base_message::FieldType;
assert_eq!(ContentTransferEncoding::parse(b"Binary"), Ok(ContentTransferEncoding::Binary));
assert!(ContentTransferEncoding::parse(b"base64").is_err());Variants§
SevenBit
7bit: lines of ASCII.
EightBit
8bit: lines that may have bytes above ASCII.
Binary
binary: any bytes.
Implementations§
Trait Implementations§
Source§impl Clone for ContentTransferEncoding
impl Clone for ContentTransferEncoding
impl Copy for ContentTransferEncoding
Source§impl Debug for ContentTransferEncoding
impl Debug for ContentTransferEncoding
Source§impl Display for ContentTransferEncoding
impl Display for ContentTransferEncoding
impl Eq for ContentTransferEncoding
Source§impl FieldType<'_> for ContentTransferEncoding
impl FieldType<'_> for ContentTransferEncoding
Source§type Combination = Singleton
type Combination = Singleton
Source§fn parse(value: &[u8]) -> Result<Self, FieldValueError>
fn parse(value: &[u8]) -> Result<Self, FieldValueError>
Parse one instance, or one element of a list, with surrounding spaces and tabs already removed. Read more
Source§const INVALID: InvalidValue = InvalidValue::Error
const INVALID: InvalidValue = InvalidValue::Error
What an invalid value means, unless a declaration overrides it with
invalid = "...". A required declaration always treats an invalid value as an error.Source§impl Hash for ContentTransferEncoding
impl Hash for ContentTransferEncoding
Source§impl PartialEq for ContentTransferEncoding
impl PartialEq for ContentTransferEncoding
impl StructuralPartialEq for ContentTransferEncoding
Auto Trait Implementations§
impl Forget for ContentTransferEncoding
impl Freeze for ContentTransferEncoding
impl RefUnwindSafe for ContentTransferEncoding
impl Send for ContentTransferEncoding
impl Sync for ContentTransferEncoding
impl Unpin for ContentTransferEncoding
impl UnsafeUnpin for ContentTransferEncoding
impl UnwindSafe for ContentTransferEncoding
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