leptos::reactive::prelude

Trait ReadUntracked

Source
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§

Source

type Value: Deref

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

Required Methods§

Source

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

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

Provided Methods§

Source

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

Returns the guard.

§Panics

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

Source

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§

Source§

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

Source§

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

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> ReadUntracked for ArcField<T>

Source§

type Value = StoreFieldReader<T>

Source§

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

Source§

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

Source§

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

Source§

type Value = StoreFieldReader<T>

Source§

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

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Value = ReadGuard<T, Mapped<Plain<MemoInner<T, S>>, T>>

Source§

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

Source§

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

Source§

type Value = ReadGuard<T, Mapped<Plain<MemoInner<T, S>>, T>>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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