[][src]Struct json_feed_model::AttachmentRef

pub struct AttachmentRef<'a> { /* fields omitted */ }

An Attachment implemented with a borrowed reference to a JSON object.

Implementations

impl<'a> AttachmentRef<'a>[src]

pub fn as_map(&self) -> &Map<String, Value>[src]

Returns the inner Map as a reference.

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]

impl<'a> PartialEq<Map<String, Value>> for AttachmentRef<'a>[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.