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 PgExecutor<'_>,
create: CreateLinkResolvedMetadata,
) -> Result<(), Error>
pub async fn create( db: impl PgExecutor<'_>, create: CreateLinkResolvedMetadata, ) -> Result<(), Error>
Create and insert a new resolved link metadata
Sourcepub async fn query(
db: impl PgExecutor<'_>,
url: &str,
) -> Result<Option<LinkResolvedMetadata>, Error>
pub async fn query( db: impl PgExecutor<'_>, url: &str, ) -> Result<Option<LinkResolvedMetadata>, Error>
Query the resolved link metadata for the provided URL
Sourcepub async fn delete_expired(
db: impl PgExecutor<'_>,
before: DateTime<Utc>,
) -> Result<PgQueryResult, Error>
pub async fn delete_expired( db: impl PgExecutor<'_>, before: DateTime<Utc>, ) -> Result<PgQueryResult, Error>
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> FromRow<'a, R> for LinkResolvedMetadata
impl<'a, R> FromRow<'a, R> for LinkResolvedMetadata
Source§impl Serialize for LinkResolvedMetadata
impl Serialize for LinkResolvedMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for LinkResolvedMetadata
impl RefUnwindSafe for LinkResolvedMetadata
impl Send for LinkResolvedMetadata
impl Sync for LinkResolvedMetadata
impl Unpin 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.