pub struct WebsiteMetaService { /* private fields */ }Expand description
Service for looking up website metadata and storing a cached value
Implementations§
Source§impl WebsiteMetaService
impl WebsiteMetaService
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new instance of the service, this initializes the HTTP client and creates the cache
Sourcepub fn from_client(client: Client) -> Self
pub fn from_client(client: Client) -> Self
Create a web scraper from the provided client
Sourcepub fn from_config(config: WebsiteMetaServiceConfig) -> Result<Self>
pub fn from_config(config: WebsiteMetaServiceConfig) -> Result<Self>
Create a web scraper from the provided config
Sourcepub fn from_client_with_config(
client: Client,
config: WebsiteMetaServiceConfig,
) -> Self
pub fn from_client_with_config( client: Client, config: WebsiteMetaServiceConfig, ) -> Self
Create a web scraper from the provided client and config
Sourcepub async fn resolve_website(
&self,
url: &Url,
) -> Option<ResolvedWebsiteMetadata>
pub async fn resolve_website( &self, url: &Url, ) -> Option<ResolvedWebsiteMetadata>
Resolves the metadata for the website at the provided URL
Sourcepub async fn resolve_website_favicon(&self, url: &Url) -> Option<ResolvedImage>
pub async fn resolve_website_favicon(&self, url: &Url) -> Option<ResolvedImage>
Resolve the favicon image at the provided URL
Sourcepub async fn resolve_website_image(&self, url: &Url) -> Option<ResolvedImage>
pub async fn resolve_website_image(&self, url: &Url) -> Option<ResolvedImage>
Resolve the OGP metadata image from the provided URL
Auto Trait Implementations§
impl Freeze for WebsiteMetaService
impl !RefUnwindSafe for WebsiteMetaService
impl Send for WebsiteMetaService
impl Sync for WebsiteMetaService
impl Unpin for WebsiteMetaService
impl !UnwindSafe for WebsiteMetaService
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