pub struct OpenGraphImage { /* private fields */ }Expand description
Open Graph image metadata.
Implementations§
Source§impl OpenGraphImage
impl OpenGraphImage
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, MetadataValueError>
pub fn new(value: impl AsRef<str>) -> Result<Self, MetadataValueError>
Creates an Open Graph image from a URL-like string.
§Errors
Returns MetadataValueError::InvalidUrl when the URL shape is unsupported.
Sourcepub fn with_dimensions(
self,
width: u32,
height: u32,
) -> Result<Self, MetadataValueError>
pub fn with_dimensions( self, width: u32, height: u32, ) -> Result<Self, MetadataValueError>
Sets image dimensions.
§Errors
Returns MetadataValueError::InvalidImageDimensions when either dimension is zero.
Trait Implementations§
Source§impl Clone for OpenGraphImage
impl Clone for OpenGraphImage
Source§fn clone(&self) -> OpenGraphImage
fn clone(&self) -> OpenGraphImage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenGraphImage
impl Debug for OpenGraphImage
Source§impl PartialEq for OpenGraphImage
impl PartialEq for OpenGraphImage
Source§fn eq(&self, other: &OpenGraphImage) -> bool
fn eq(&self, other: &OpenGraphImage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for OpenGraphImage
impl StructuralPartialEq for OpenGraphImage
Auto Trait Implementations§
impl Freeze for OpenGraphImage
impl RefUnwindSafe for OpenGraphImage
impl Send for OpenGraphImage
impl Sync for OpenGraphImage
impl Unpin for OpenGraphImage
impl UnsafeUnpin for OpenGraphImage
impl UnwindSafe for OpenGraphImage
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