pub struct LinkResolvedMetadata {
pub url: String,
pub metadata: StoredResolvedWebsiteMetadata,
pub expires_at: DateTime<Utc>,
}Fields§
§url: StringURL of the resolved metadata
metadata: StoredResolvedWebsiteMetadataThe metadata itself
expires_at: DateTime<Utc>Timestamp of when the metadata will expire
Implementations§
Source§impl LinkResolvedMetadata
impl LinkResolvedMetadata
Sourcepub async fn create(
db: impl DbExecutor<'_>,
create: CreateLinkResolvedMetadata,
) -> DbResult<()>
pub async fn create( db: impl DbExecutor<'_>, create: CreateLinkResolvedMetadata, ) -> DbResult<()>
Create and insert a new resolved link metadata
Sourcepub async fn query(
db: impl DbExecutor<'_>,
url: &str,
) -> DbResult<Option<LinkResolvedMetadata>>
pub async fn query( db: impl DbExecutor<'_>, url: &str, ) -> DbResult<Option<LinkResolvedMetadata>>
Query the resolved link metadata for the provided URL
Sourcepub async fn delete_expired(
db: impl DbExecutor<'_>,
before: DateTime<Utc>,
) -> DbResult<PgQueryResult>
pub async fn delete_expired( db: impl DbExecutor<'_>, before: DateTime<Utc>, ) -> DbResult<PgQueryResult>
Deletes all metadata where the expiry date is less than before
Trait Implementations§
Source§impl Clone for LinkResolvedMetadata
impl Clone for LinkResolvedMetadata
Source§fn clone(&self) -> LinkResolvedMetadata
fn clone(&self) -> LinkResolvedMetadata
Returns a duplicate of the value. Read more
1.0.0 · 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 LinkResolvedMetadata
impl Debug for LinkResolvedMetadata
Source§impl<'a, R: Row> FromRow<'a, R> for LinkResolvedMetadata
impl<'a, R: Row> FromRow<'a, R> for LinkResolvedMetadata
Auto Trait Implementations§
impl Freeze for LinkResolvedMetadata
impl RefUnwindSafe for LinkResolvedMetadata
impl Send for LinkResolvedMetadata
impl Sync for LinkResolvedMetadata
impl Unpin for LinkResolvedMetadata
impl UnsafeUnpin for LinkResolvedMetadata
impl UnwindSafe for LinkResolvedMetadata
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,
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 moreCreates a shared type from an unshared type.