pub struct ImageMetadata {
pub id: String,
pub asset: String,
pub media_type: String,
pub role: ImageRole,
pub caption: Option<String>,
pub alt: Option<String>,
pub intrinsic_size: Option<IntrinsicSize>,
pub hash: Option<String>,
pub accessibility: Option<AccessibilityMetadata>,
pub meaningful_content: Option<MeaningfulContent>,
}Expand description
Parsed image metadata object.
Fields§
§id: StringStable image id.
asset: StringPackage asset path.
media_type: StringDeclared asset media type.
role: ImageRoleImage role.
caption: Option<String>Optional caption.
alt: Option<String>Optional alt text.
intrinsic_size: Option<IntrinsicSize>Optional intrinsic size.
hash: Option<String>Optional asset hash.
accessibility: Option<AccessibilityMetadata>Optional accessibility override.
meaningful_content: Option<MeaningfulContent>Optional declaration for meaningful visual-only content.
Implementations§
Source§impl ImageMetadata
impl ImageMetadata
Sourcepub fn from_package(package: &McdPackage, path: &str) -> Result<Self>
pub fn from_package(package: &McdPackage, path: &str) -> Result<Self>
Parse image metadata from a package entry.
Trait Implementations§
Source§impl Clone for ImageMetadata
impl Clone for ImageMetadata
Source§impl Debug for ImageMetadata
impl Debug for ImageMetadata
Source§impl<'de> Deserialize<'de> for ImageMetadata
impl<'de> Deserialize<'de> for ImageMetadata
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 Eq for ImageMetadata
Source§impl PartialEq for ImageMetadata
impl PartialEq for ImageMetadata
Source§impl Serialize for ImageMetadata
impl Serialize for ImageMetadata
impl StructuralPartialEq for ImageMetadata
Auto Trait Implementations§
impl Freeze for ImageMetadata
impl RefUnwindSafe for ImageMetadata
impl Send for ImageMetadata
impl Sync for ImageMetadata
impl Unpin for ImageMetadata
impl UnsafeUnpin for ImageMetadata
impl UnwindSafe for ImageMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.