pub struct AttachmentMut<'a> { /* private fields */ }
Expand description
An Attachment
implemented with a borrowed mutable reference to a JSON object.
Implementations§
Source§impl<'a> AttachmentMut<'a>
impl<'a> AttachmentMut<'a>
Source§impl<'a> AttachmentMut<'a>
impl<'a> AttachmentMut<'a>
Sourcepub fn as_map_mut(&mut self) -> &mut Map<String, Value>
pub fn as_map_mut(&mut self) -> &mut Map<String, Value>
Returns the inner Map
as a mutable reference.
Sourcepub fn to_attachment(&self) -> Attachment
pub fn to_attachment(&self) -> Attachment
Clones the inner Map
reference and returns an owned type.
Sourcepub fn remove_url(&mut self) -> Option<Value>
pub fn remove_url(&mut self) -> Option<Value>
Removes the URL.
Sourcepub fn mime_type(&self) -> Result<Option<&str>, Error>
pub fn mime_type(&self) -> Result<Option<&str>, Error>
The required MIME type (e.g. image/png).
Sourcepub fn set_mime_type<T>(&mut self, value: T) -> Option<Value>where
T: ToString,
pub fn set_mime_type<T>(&mut self, value: T) -> Option<Value>where
T: ToString,
Sets the MIME type.
Sourcepub fn remove_mime_type(&mut self) -> Option<Value>
pub fn remove_mime_type(&mut self) -> Option<Value>
Removes the MIME type.
Sourcepub fn title(&self) -> Result<Option<&str>, Error>
pub fn title(&self) -> Result<Option<&str>, Error>
An optional title for the attachment.
§Important
Attachments with the same title are considered to be alternative representations of an attachment.
Sourcepub fn remove_title(&mut self) -> Option<Value>
pub fn remove_title(&mut self) -> Option<Value>
Removes the title.
Sourcepub fn size_in_bytes(&self) -> Result<Option<u64>, Error>
pub fn size_in_bytes(&self) -> Result<Option<u64>, Error>
The optional size of the attachment in bytes.
Sourcepub fn set_size_in_bytes<T>(&mut self, value: u64) -> Option<Value>
pub fn set_size_in_bytes<T>(&mut self, value: u64) -> Option<Value>
Sets the size in bytes.
Sourcepub fn remove_size_in_bytes<T>(&mut self) -> Option<Value>where
T: ToString,
pub fn remove_size_in_bytes<T>(&mut self) -> Option<Value>where
T: ToString,
Removes the size in bytes.
Sourcepub fn duration_in_seconds(&self) -> Result<Option<u64>, Error>
pub fn duration_in_seconds(&self) -> Result<Option<u64>, Error>
The optional duration of the content in seconds.
Sourcepub fn set_duration_in_seconds<T>(&mut self, value: u64) -> Option<Value>
pub fn set_duration_in_seconds<T>(&mut self, value: u64) -> Option<Value>
Sets the duration of in seconds.
Sourcepub fn remove_duration_in_seconds<T>(&mut self) -> Option<Value>where
T: ToString,
pub fn remove_duration_in_seconds<T>(&mut self) -> Option<Value>where
T: ToString,
Removes the duration in seconds.
Trait Implementations§
Source§impl<'a> Debug for AttachmentMut<'a>
impl<'a> Debug for AttachmentMut<'a>
Source§impl<'a> PartialEq for AttachmentMut<'a>
impl<'a> PartialEq for AttachmentMut<'a>
Source§impl<'a> Serialize for AttachmentMut<'a>
impl<'a> Serialize for AttachmentMut<'a>
impl<'a> Eq for AttachmentMut<'a>
Auto Trait Implementations§
impl<'a> Freeze for AttachmentMut<'a>
impl<'a> RefUnwindSafe for AttachmentMut<'a>
impl<'a> Send for AttachmentMut<'a>
impl<'a> Sync for AttachmentMut<'a>
impl<'a> Unpin for AttachmentMut<'a>
impl<'a> !UnwindSafe for AttachmentMut<'a>
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