pub struct Image {
pub content_url: String,
pub width: Option<u64>,
pub height: Option<u64>,
pub caption: Option<String>,
pub alternative_text: Option<String>,
}Expand description
Image metadata.
Describes an image associated with an article. Includes dimensions and accessibility information.
§Example
use wme_models::Image;
let image = Image {
content_url: "https://upload.wikimedia.org/...".to_string(),
width: Some(800),
height: Some(600),
caption: Some("A squirrel in a tree".to_string()),
alternative_text: Some("Gray squirrel sitting on branch".to_string()),
};Fields§
§content_url: StringContent URL (direct link to image file)
width: Option<u64>Image width in pixels
height: Option<u64>Image height in pixels
caption: Option<String>Image caption (displayed below image)
alternative_text: Option<String>Alternative text for accessibility (screen readers)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Image
impl<'de> Deserialize<'de> for Image
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
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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