pub struct Meta { /* private fields */ }Expand description
Page metadata rendered into a document’s <head>: the title, description,
optional canonical URL, and optional social-share image. Meta::head_tags
renders the standard <title>, <meta>, and Open Graph tags so every page is
described and shareable the same way.
Implementations§
Source§impl Meta
impl Meta
Sourcepub fn new(title: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(title: impl Into<String>, description: impl Into<String>) -> Self
A page’s title and description. Both appear in search results and social cards, so keep them human and specific.
Sourcepub fn canonical(self, url: impl Into<String>) -> Self
pub fn canonical(self, url: impl Into<String>) -> Self
The canonical absolute URL for this page (also used as the Open Graph URL).
Sourcepub fn image(self, url: impl Into<String>) -> Self
pub fn image(self, url: impl Into<String>) -> Self
The absolute URL of the social-share image (Open Graph / Twitter card).
Renders the <head> tags for this page: title, description, canonical
link, and Open Graph / Twitter card metadata. Embed the result inside the
document <head>. All values are HTML-attribute escaped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Meta
impl RefUnwindSafe for Meta
impl Send for Meta
impl Sync for Meta
impl Unpin for Meta
impl UnsafeUnpin for Meta
impl UnwindSafe for Meta
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more