[−][src]Struct json_feed_model::AttachmentRef
An Attachment
implemented with a borrowed reference to a JSON object.
Implementations
impl<'a> AttachmentRef<'a>
[src]
impl<'a> AttachmentRef<'a>
[src]
pub fn to_attachment(&self) -> Attachment
[src]
Clones the inner Map
reference and returns an owned type.
pub fn url(&self) -> Result<Option<&str>, Error>
[src]
The required URL for the attachment.
pub fn mime_type(&self) -> Result<Option<&str>, Error>
[src]
The required MIME type (e.g. image/png).
pub fn title(&self) -> Result<Option<&str>, Error>
[src]
An optional title for the attachment.
Important
Attachments with the same title are considered to be alternative representations of an attachment.
pub fn size_in_bytes(&self) -> Result<Option<u64>, Error>
[src]
The optional size of the attachment in bytes.
pub fn duration_in_seconds(&self) -> Result<Option<u64>, Error>
[src]
The optional duration of the content in seconds.
impl<'a> AttachmentRef<'a>
[src]
pub fn is_valid(&self, version: &Version<'_>) -> bool
[src]
Verifies if the JSON data complies with a specific Version
of the JSON Feed spec.
Trait Implementations
impl<'a> AsRef<Map<String, Value>> for AttachmentRef<'a>
[src]
impl<'a> Debug for AttachmentRef<'a>
[src]
impl<'a> Eq for AttachmentRef<'a>
[src]
impl<'a> From<&'a Map<String, Value>> for AttachmentRef<'a>
[src]
impl<'a> From<&'a mut Map<String, Value>> for AttachmentRef<'a>
[src]
impl<'a> PartialEq<AttachmentRef<'a>> for AttachmentRef<'a>
[src]
fn eq(&self, other: &AttachmentRef<'_>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<Map<String, Value>> for AttachmentRef<'a>
[src]
fn eq(&self, other: &Map<String, Value>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> Serialize for AttachmentRef<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for AttachmentRef<'a>
impl<'a> Send for AttachmentRef<'a>
impl<'a> Sync for AttachmentRef<'a>
impl<'a> Unpin for AttachmentRef<'a>
impl<'a> UnwindSafe for AttachmentRef<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,