pub struct ReadRef<T>(/* private fields */);
Expand description
The read value of a value cell. The read value is immutable, while the cell itself might change over time. It’s basically a snapshot of a value at a certain point in time.
Internally it stores a reference counted reference to a value on the heap.
Implementations§
Source§impl<T> ReadRef<T>where
T: VcValueType,
impl<T> ReadRef<T>where
T: VcValueType,
Source§impl<T> ReadRef<T>where
T: VcValueType,
impl<T> ReadRef<T>where
T: VcValueType,
Sourcepub fn try_unwrap(
this: Self,
) -> Result<<<T as VcValueType>::Read as VcRead<T>>::Target, Self>
pub fn try_unwrap( this: Self, ) -> Result<<<T as VcValueType>::Read as VcRead<T>>::Target, Self>
Source§impl<T> ReadRef<T>
impl<T> ReadRef<T>
Sourcepub fn into_owned(this: Self) -> <<T as VcValueType>::Read as VcRead<T>>::Target
pub fn into_owned(this: Self) -> <<T as VcValueType>::Read as VcRead<T>>::Target
This is return a owned version of the value. It potentially clones the value. The clone might be expensive. Prefer Deref to get a reference to the value.
Trait Implementations§
Source§impl<T> Deref for ReadRef<T>where
T: VcValueType,
impl<T> Deref for ReadRef<T>where
T: VcValueType,
Source§impl<'de, T> Deserialize<'de> for ReadRef<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ReadRef<T>where
T: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> DeterministicHash for ReadRef<T>
impl<T> DeterministicHash for ReadRef<T>
Source§fn deterministic_hash<H: DeterministicHasher>(&self, state: &mut H)
fn deterministic_hash<H: DeterministicHasher>(&self, state: &mut H)
Adds
self
’s bytes to the DeterministicHasher
’s state, in a way that is replicatable on
any platform or process run.Source§impl<'a, T, I, J: Iterator<Item = I>> IntoIterator for &'a ReadRef<T>where
T: VcValueType,
&'a <<T as VcValueType>::Read as VcRead<T>>::Target: IntoIterator<Item = I, IntoIter = J>,
impl<'a, T, I, J: Iterator<Item = I>> IntoIterator for &'a ReadRef<T>where
T: VcValueType,
&'a <<T as VcValueType>::Read as VcRead<T>>::Target: IntoIterator<Item = I, IntoIter = J>,
Source§impl<T, I: 'static, J: Iterator<Item = I>> IntoIterator for ReadRef<T>where
T: VcValueType,
&'static <<T as VcValueType>::Read as VcRead<T>>::Target: IntoIterator<Item = I, IntoIter = J>,
impl<T, I: 'static, J: Iterator<Item = I>> IntoIterator for ReadRef<T>where
T: VcValueType,
&'static <<T as VcValueType>::Read as VcRead<T>>::Target: IntoIterator<Item = I, IntoIter = J>,
Source§impl<T> Ord for ReadRef<T>
impl<T> Ord for ReadRef<T>
Source§impl<T> PartialOrd for ReadRef<T>
impl<T> PartialOrd for ReadRef<T>
Source§impl<T> TraceRawVcs for ReadRef<T>
impl<T> TraceRawVcs for ReadRef<T>
fn trace_raw_vcs(&self, trace_context: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
Source§impl<T> ValueDebugFormat for ReadRef<T>
impl<T> ValueDebugFormat for ReadRef<T>
fn value_debug_format(&self, depth: usize) -> ValueDebugFormatString<'_>
impl<T> Eq for ReadRef<T>
impl<T> NonLocalValue for ReadRef<T>
impl<T> OperationValue for ReadRef<T>
Auto Trait Implementations§
impl<T> Freeze for ReadRef<T>
impl<T> RefUnwindSafe for ReadRef<T>where
T: RefUnwindSafe,
impl<T> Send for ReadRef<T>
impl<T> Sync for ReadRef<T>
impl<T> Unpin for ReadRef<T>where
T: Unpin,
impl<T> UnwindSafe for ReadRef<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> DynamicEqHash for T
impl<T> DynamicEqHash for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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