pub struct Sitemap { /* private fields */ }Expand description
A sitemap.xml document. Element order follows the official schema.
Implementations§
Source§impl Sitemap
impl Sitemap
pub fn new(origin: &str) -> Result<Sitemap, DiscoveryError>
pub fn with_base_path(self, base_path: BasePath) -> Sitemap
pub fn with_url( self, path: impl Into<String>, ) -> Result<Sitemap, DiscoveryError>
Sourcepub fn with_entry(self, url: SitemapUrl) -> Result<Sitemap, DiscoveryError>
pub fn with_entry(self, url: SitemapUrl) -> Result<Sitemap, DiscoveryError>
Add an entry. Absolute entries must use the sitemap origin, because the default sitemap scope is same-origin. Ownership-verified cross-submission is outside this API. Rendering checks the normalized URL path against the final base path. Custom handlers must set the base path to the document’s directory.
pub fn origin(&self) -> &str
pub fn urls(&self) -> &[SitemapUrl]
Sourcepub fn render_xml(&self) -> Result<String, DiscoveryError>
pub fn render_xml(&self) -> Result<String, DiscoveryError>
Render the sitemap protocol XML.
Allocates an owned XML body outside HTML page rendering. The framework builder calls this once at startup; custom handlers control their own refresh. Validated URL components are escaped directly into the output without allocating temporary URL strings or reparsing URLs for each entry.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Sitemap
impl Freeze for Sitemapwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
PhantomData<SitemapUrl>: Freeze,
impl Move for Sitemap
impl RefUnwindSafe for Sitemap
impl Send for Sitemap
impl Sync for Sitemap
impl Unpin for Sitemap
impl UnsafeUnpin for Sitemapwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
PhantomData<SitemapUrl>: UnsafeUnpin,
impl UnwindSafe for Sitemap
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> ErasedDestructor for Twhere
T: 'static,
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