pub struct Media {
pub base_uri: Option<Url>,
pub token: Vec<String>,
pub types: Vec<MediaType>,
pub pretty_name: Option<String>,
pub unknown: HashMap<String, Value>,
}Expand description
A structure that stores media metadata.
Needed to create image urls.
Fields§
§base_uri: Option<Url>The base uri
token: Vec<String>Image token
types: Vec<MediaType>Types
pretty_name: Option<String>Pretty Name
unknown: HashMap<String, Value>Unknown K/Vs
Implementations§
Source§impl Media
impl Media
Sourcepub fn get_fullview_media_type(&self) -> Option<&MediaType>
pub fn get_fullview_media_type(&self) -> Option<&MediaType>
Try to get the fullview MediaType.
Sourcepub fn get_gif_media_type(&self) -> Option<&MediaType>
pub fn get_gif_media_type(&self) -> Option<&MediaType>
Try to get the gif MediaType.
Sourcepub fn get_best_video_media_type(&self) -> Option<&MediaType>
pub fn get_best_video_media_type(&self) -> Option<&MediaType>
Try to get the video MediaType
Sourcepub fn get_fullview_url(&self) -> Option<Url>
pub fn get_fullview_url(&self) -> Option<Url>
Get the fullview url for this Media.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Media
impl<'de> Deserialize<'de> for Media
Source§fn 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
Auto Trait Implementations§
impl Freeze for Media
impl RefUnwindSafe for Media
impl Send for Media
impl Sync for Media
impl Unpin for Media
impl UnwindSafe for Media
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