pub struct SocialPreview { /* private fields */ }Expand description
Social preview metadata.
Implementations§
Source§impl SocialPreview
impl SocialPreview
Sourcepub const fn new(title: MetadataTitle, description: MetadataDescription) -> Self
pub const fn new(title: MetadataTitle, description: MetadataDescription) -> Self
Creates a social preview with default website/summary labels.
Sourcepub fn with_image(self, image: OpenGraphImage) -> Self
pub fn with_image(self, image: OpenGraphImage) -> Self
Sets the preview image.
Sourcepub const fn with_open_graph_type(self, value: OpenGraphType) -> Self
pub const fn with_open_graph_type(self, value: OpenGraphType) -> Self
Sets the Open Graph type.
Sourcepub const fn with_twitter_card(self, value: TwitterCardKind) -> Self
pub const fn with_twitter_card(self, value: TwitterCardKind) -> Self
Sets the Twitter card kind.
Sourcepub const fn open_graph_type(&self) -> OpenGraphType
pub const fn open_graph_type(&self) -> OpenGraphType
Returns the Open Graph type.
Trait Implementations§
Source§impl Clone for SocialPreview
impl Clone for SocialPreview
Source§fn clone(&self) -> SocialPreview
fn clone(&self) -> SocialPreview
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 SocialPreview
impl Debug for SocialPreview
Source§impl PartialEq for SocialPreview
impl PartialEq for SocialPreview
Source§fn eq(&self, other: &SocialPreview) -> bool
fn eq(&self, other: &SocialPreview) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SocialPreview
impl StructuralPartialEq for SocialPreview
Auto Trait Implementations§
impl Freeze for SocialPreview
impl RefUnwindSafe for SocialPreview
impl Send for SocialPreview
impl Sync for SocialPreview
impl Unpin for SocialPreview
impl UnsafeUnpin for SocialPreview
impl UnwindSafe for SocialPreview
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