Struct json_feed_model::Attachment
source · [−]pub struct Attachment { /* private fields */ }
Expand description
A relevant resource for an Item
.
Valid Attachment
An Attachment
must have both the url
and mime_type
properties set.
Implementations
sourceimpl Attachment
impl Attachment
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 into_inner(self) -> Map<String, Value>
pub fn into_inner(self) -> Map<String, Value>
Converts the type into the inner Map
.
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 Clone for Attachment
impl Clone for Attachment
sourcefn clone(&self) -> Attachment
fn clone(&self) -> Attachment
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Attachment
impl Debug for Attachment
sourceimpl Default for Attachment
impl Default for Attachment
sourceimpl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Attachment> for Attachment
impl PartialEq<Attachment> for Attachment
sourceimpl Serialize for Attachment
impl Serialize for Attachment
impl Eq for Attachment
Auto Trait Implementations
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnwindSafe for Attachment
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more