pub struct Durability(/* private fields */);
Expand description
Describes how likely a value is to change – how “durable” it is.
By default, inputs have Durability::LOW
and interned values have
Durability::HIGH
. But inputs can be explicitly set with other
durabilities.
We use durabilities to optimize the work of “revalidating” a query after some input has changed. Ordinarily, in a new revision, queries have to trace all their inputs back to the base inputs to determine if any of those inputs have changed. But if we know that the only changes were to inputs of low durability (the common case), and we know that the query only used inputs of medium durability or higher, then we can skip that enumeration.
Typically, one assigns low durabilities to inputs that the user is frequently editing. Medium or high durabilities are used for configuration, the source from library crates, or other things that are unlikely to be edited.
Implementations§
Source§impl Durability
impl Durability
Sourcepub const LOW: Durability
pub const LOW: Durability
Low durability: things that change frequently.
Example: part of the crate being edited
Sourcepub const MEDIUM: Durability
pub const MEDIUM: Durability
Medium durability: things that change sometimes, but rarely.
Example: a Cargo.toml file
Sourcepub const HIGH: Durability
pub const HIGH: Durability
High durability: things that are not expected to change under common usage.
Example: the standard library or something from crates.io
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Durability
impl Debug for Durability
Source§impl Ord for Durability
impl Ord for Durability
Source§fn cmp(&self, other: &Durability) -> Ordering
fn cmp(&self, other: &Durability) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Durability
impl PartialEq for Durability
Source§impl PartialOrd for Durability
impl PartialOrd for Durability
impl Copy for Durability
impl Eq for Durability
impl StructuralPartialEq for Durability
Auto Trait Implementations§
impl Freeze for Durability
impl RefUnwindSafe for Durability
impl Send for Durability
impl Sync for Durability
impl Unpin for Durability
impl UnwindSafe for Durability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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