pub struct ResolvedEntity {
pub type_name: String,
pub key_json: String,
pub data_json: String,
pub resolved_at: Instant,
pub ttl: Duration,
}Expand description
A serialisable entity representation.
Entities are keyed by (type_name, key_json) where key_json is the
JSON-encoded representation of the entity’s @key fields.
Fields§
§type_name: StringGraphQL type name (e.g. "Product").
key_json: StringJSON-encoded entity key fields.
data_json: StringJSON-encoded resolved entity data.
resolved_at: InstantWhen this entity was resolved.
ttl: DurationHow long this entity should be cached.
Implementations§
Source§impl ResolvedEntity
impl ResolvedEntity
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if this entity has expired.
Sourcepub fn remaining_ttl(&self) -> Duration
pub fn remaining_ttl(&self) -> Duration
Remaining time-to-live (saturating at zero).
Trait Implementations§
Source§impl Clone for ResolvedEntity
impl Clone for ResolvedEntity
Auto Trait Implementations§
impl Freeze for ResolvedEntity
impl RefUnwindSafe for ResolvedEntity
impl Send for ResolvedEntity
impl Sync for ResolvedEntity
impl Unpin for ResolvedEntity
impl UnsafeUnpin for ResolvedEntity
impl UnwindSafe for ResolvedEntity
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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 more