Struct json_feed_model::AttachmentMut
source · [−]pub struct AttachmentMut<'a> { /* private fields */ }
Expand description
An Attachment
implemented with a borrowed mutable reference to a JSON object.
Implementations
sourceimpl<'a> AttachmentMut<'a>
impl<'a> AttachmentMut<'a>
sourceimpl<'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
sourceimpl<'a> Debug for AttachmentMut<'a>
impl<'a> Debug for AttachmentMut<'a>
sourceimpl<'a> PartialEq<AttachmentMut<'a>> for AttachmentMut<'a>
impl<'a> PartialEq<AttachmentMut<'a>> for AttachmentMut<'a>
sourceimpl<'a> Serialize for AttachmentMut<'a>
impl<'a> Serialize for AttachmentMut<'a>
impl<'a> Eq for AttachmentMut<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more