Trait ReadUntracked

pub trait ReadUntracked: Sized + DefinedAt {
    type Value: Deref;

    // Required method
    fn try_read_untracked(&self) -> Option<Self::Value>;

    // Provided methods
    fn read_untracked(&self) -> Self::Value { ... }
    fn custom_try_read(&self) -> Option<Option<Self::Value>> { ... }
}
Expand description

Give read-only access to a signal’s value by reference through a guard type, without tracking the value reactively.

Required Associated Types§

type Value: Deref

The guard type that will be returned, which can be dereferenced to the value.

Required Methods§

fn try_read_untracked(&self) -> Option<Self::Value>

Returns the guard, or None if the signal has already been disposed.

Provided Methods§

fn read_untracked(&self) -> Self::Value

Returns the guard.

§Panics

Panics if you try to access a signal that has been disposed.

fn custom_try_read(&self) -> Option<Option<Self::Value>>

This is a backdoor to allow overriding the Read::try_read implementation despite it being auto implemented.

If your type contains a Signal, call it’s ReadUntracked::custom_try_read here, else return None.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<Inner, Prev> ReadUntracked for AtIndex<Inner, Prev>
where Inner: StoreField<Value = Prev>, Prev: IndexMut<usize> + 'static, <Prev as Index<usize>>::Output: Sized,

§

type Value = <AtIndex<Inner, Prev> as StoreField>::Reader

§

fn try_read_untracked( &self, ) -> Option<<AtIndex<Inner, Prev> as ReadUntracked>::Value>

§

impl<Inner, Prev, K, T> ReadUntracked for AtKeyed<Inner, Prev, K, T>
where K: Debug + Send + Sync + PartialEq + Eq + Hash + 'static, KeyedSubfield<Inner, Prev, K, T>: Clone, &'a T: for<'a> IntoIterator, Inner: StoreField<Value = Prev>, Prev: 'static, T: IndexMut<usize>, <T as Index<usize>>::Output: Sized,

§

type Value = <AtKeyed<Inner, Prev, K, T> as StoreField>::Reader

§

fn try_read_untracked( &self, ) -> Option<<AtKeyed<Inner, Prev, K, T> as ReadUntracked>::Value>

§

impl<Inner, Prev, K, T> ReadUntracked for KeyedSubfield<Inner, Prev, K, T>
where KeyedSubfield<Inner, Prev, K, T>: Clone, &'a T: for<'a> IntoIterator, Inner: StoreField<Value = Prev>, Prev: 'static, K: Debug + Send + Sync + PartialEq + Eq + Hash + 'static,

§

type Value = <KeyedSubfield<Inner, Prev, K, T> as StoreField>::Reader

§

fn try_read_untracked( &self, ) -> Option<<KeyedSubfield<Inner, Prev, K, T> as ReadUntracked>::Value>

§

impl<Inner, Prev, T> ReadUntracked for Subfield<Inner, Prev, T>
where Inner: StoreField<Value = Prev>, Prev: 'static,

§

type Value = <Subfield<Inner, Prev, T> as StoreField>::Reader

§

fn try_read_untracked( &self, ) -> Option<<Subfield<Inner, Prev, T> as ReadUntracked>::Value>

§

impl<S> ReadUntracked for DerefedField<S>
where S: StoreField, <S as StoreField>::Value: Deref + DerefMut, <<S as StoreField>::Value as Deref>::Target: Sized + 'static,

§

type Value = <DerefedField<S> as StoreField>::Reader

§

fn try_read_untracked( &self, ) -> Option<<DerefedField<S> as ReadUntracked>::Value>

§

impl<T> ReadUntracked for ArcField<T>

§

type Value = StoreFieldReader<T>

§

fn try_read_untracked(&self) -> Option<<ArcField<T> as ReadUntracked>::Value>

§

impl<T> ReadUntracked for ArcStore<T>
where T: 'static,

§

type Value = ReadGuard<T, Plain<T>>

§

fn try_read_untracked(&self) -> Option<<ArcStore<T> as ReadUntracked>::Value>

§

impl<T, S> ReadUntracked for Field<T, S>
where S: Storage<ArcField<T>>,

§

type Value = StoreFieldReader<T>

§

fn try_read_untracked(&self) -> Option<<Field<T, S> as ReadUntracked>::Value>

§

impl<T, S> ReadUntracked for Store<T, S>
where T: 'static, S: Storage<ArcStore<T>>,

§

type Value = ReadGuard<T, Plain<T>>

§

fn try_read_untracked(&self) -> Option<<Store<T, S> as ReadUntracked>::Value>

Implementors§

§

impl<E> ReadUntracked for NodeRef<E>
where E: ElementType, <E as ElementType>::Output: JsCast + Clone + 'static,

§

type Value = ReadGuard<Option<<E as ElementType>::Output>, Derefable<Option<<E as ElementType>::Output>>>

§

impl<T> ReadUntracked for ArcAsyncDerived<T>
where T: 'static,

§

type Value = ReadGuard<Option<T>, Mapped<AsyncPlain<SendOption<T>>, Option<T>>>

§

impl<T> ReadUntracked for ArcLocalResource<T>
where T: 'static,

§

type Value = ReadGuard<Option<T>, Mapped<AsyncPlain<SendOption<T>>, Option<T>>>

§

impl<T> ReadUntracked for ArcMappedSignal<T>

§

type Value = DoubleDeref<Box<dyn Deref<Target = T>>>

§

impl<T> ReadUntracked for ArcReadSignal<T>
where T: 'static,

§

type Value = ReadGuard<T, Plain<T>>

§

impl<T> ReadUntracked for ArcRwSignal<T>
where T: 'static,

§

type Value = ReadGuard<T, Plain<T>>

§

impl<T> ReadUntracked for LocalResource<T>
where T: 'static,

§

type Value = ReadGuard<Option<T>, Mapped<AsyncPlain<SendOption<T>>, Option<T>>>

§

impl<T> ReadUntracked for MappedSignal<T>
where T: 'static,

§

type Value = DoubleDeref<Box<dyn Deref<Target = T>>>

§

impl<T, S> ReadUntracked for MaybeSignal<T, S>
where T: Clone, S: Storage<SignalTypes<T, S>> + Storage<T>,

§

impl<T, S> ReadUntracked for ArcMemo<T, S>
where T: 'static, S: Storage<T>,

§

type Value = ReadGuard<T, Mapped<Plain<Option<<S as Storage<T>>::Wrapped>>, T>>

§

impl<T, S> ReadUntracked for ArcSignal<T, S>
where S: Storage<T>,

§

impl<T, S> ReadUntracked for AsyncDerived<T, S>
where T: 'static, S: Storage<ArcAsyncDerived<T>>,

§

type Value = ReadGuard<Option<T>, Mapped<AsyncPlain<SendOption<T>>, Option<T>>>

§

impl<T, S> ReadUntracked for MaybeProp<T, S>
where T: Clone, S: Storage<Option<T>> + Storage<SignalTypes<Option<T>, S>>,

§

impl<T, S> ReadUntracked for Memo<T, S>
where T: 'static, S: Storage<ArcMemo<T, S>> + Storage<T>,

§

type Value = ReadGuard<T, Mapped<Plain<Option<<S as Storage<T>>::Wrapped>>, T>>

§

impl<T, S> ReadUntracked for ReadSignal<T, S>
where T: 'static, S: Storage<ArcReadSignal<T>>,

§

type Value = ReadGuard<T, Plain<T>>

§

impl<T, S> ReadUntracked for RwSignal<T, S>
where T: 'static, S: Storage<ArcRwSignal<T>>,

§

type Value = ReadGuard<T, Plain<T>>

§

impl<T, S> ReadUntracked for Signal<T, S>
where T: 'static, S: Storage<SignalTypes<T, S>> + Storage<T>,

§

impl<T, Ser> ReadUntracked for ArcOnceResource<T, Ser>
where T: 'static,

§

impl<T, Ser> ReadUntracked for ArcResource<T, Ser>
where T: 'static,

§

impl<T, Ser> ReadUntracked for OnceResource<T, Ser>
where T: Send + Sync + 'static, Ser: 'static,

§

impl<T, Ser> ReadUntracked for Resource<T, Ser>
where T: Send + Sync + 'static,