pub struct Attachment {
pub bytes: Vec<u8>,
pub mime: String,
pub filename: String,
}Expand description
Binary object: bytes + mime + filename, all mandatory and non-blank.
Fields§
§bytes: Vec<u8>BT-125 attached document bytes.
mime: StringMIME code of BT-125. Mandatory, non-blank.
filename: StringFilename of BT-125. Mandatory, non-blank.
Implementations§
Source§impl Attachment
impl Attachment
Sourcepub const RECEIVER_MUST_ACCEPT: &'static [&'static str]
pub const RECEIVER_MUST_ACCEPT: &'static [&'static str]
CEN receiver-must-accept MIME list. Advisory; the constructor does not restrict to this.
Sourcepub fn new(
bytes: Vec<u8>,
mime: impl Into<String>,
filename: impl Into<String>,
) -> Result<Self, AttachmentError>
pub fn new( bytes: Vec<u8>, mime: impl Into<String>, filename: impl Into<String>, ) -> Result<Self, AttachmentError>
Bytes + mime + filename. Blank mime or filename is Err.
Sourcepub fn is_universally_accepted(&self) -> bool
pub fn is_universally_accepted(&self) -> bool
Whether mime is on the CEN receiver-must-accept list.
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Attachment
impl Debug for Attachment
impl Eq for Attachment
Source§impl PartialEq for Attachment
impl PartialEq for Attachment
impl StructuralPartialEq for Attachment
Auto Trait Implementations§
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
impl UnwindSafe for Attachment
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