pub struct SitemapCache { /* private fields */ }Expand description
Cache for parsed sitemap data.
Fetches and parses sitemaps once per URL, then serves cached results.
Implementations§
Source§impl SitemapCache
impl SitemapCache
Sourcepub fn new(client: Arc<HttpClient>) -> Self
pub fn new(client: Arc<HttpClient>) -> Self
Create a new cache.
Sourcepub async fn fetch(&self, sitemap_url: &str) -> Vec<SitemapEntry>
pub async fn fetch(&self, sitemap_url: &str) -> Vec<SitemapEntry>
Fetch and parse a sitemap URL.
Returns the list of sitemap entries. Handles both <urlset> and
<sitemapindex> formats. For indexes, recursively fetches child
sitemaps (up to 2 levels deep).
Sourcepub async fn fetch_all(&self, urls: &[String]) -> Vec<SitemapEntry>
pub async fn fetch_all(&self, urls: &[String]) -> Vec<SitemapEntry>
Get all entries from multiple sitemap URLs.
Sourcepub fn cached_count(&self) -> usize
pub fn cached_count(&self) -> usize
Get the total number of cached entries.
Auto Trait Implementations§
impl !RefUnwindSafe for SitemapCache
impl !UnwindSafe for SitemapCache
impl Freeze for SitemapCache
impl Send for SitemapCache
impl Sync for SitemapCache
impl Unpin for SitemapCache
impl UnsafeUnpin for SitemapCache
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> 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