Trait Write

pub trait Write:
    Sized
    + DefinedAt
    + Notify {
    type Value: 'static;

    // Required methods
    fn try_write(&self) -> Option<impl UntrackableGuard>;
    fn try_write_untracked(&self) -> Option<impl DerefMut>;

    // Provided methods
    fn write(&self) -> impl UntrackableGuard { ... }
    fn write_untracked(&self) -> impl DerefMut { ... }
}
Expand description

Gives mutable access to a signal’s value through a guard type. When the guard is dropped, the signal’s subscribers will be notified.

Required Associated Types§

type Value: 'static

The type of the signal’s value.

Required Methods§

fn try_write(&self) -> Option<impl UntrackableGuard>

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

fn try_write_untracked(&self) -> Option<impl DerefMut>

or None if the signal has already been disposed.

Provided Methods§

fn write(&self) -> impl UntrackableGuard

Returns the guard.

§Panics

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

fn write_untracked(&self) -> impl DerefMut

Returns a guard that will not notify subscribers when dropped.

§Panics

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

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> Write for AtIndex<Inner, Prev>
where Inner: StoreField<Value = Prev>, Prev: IndexMut<usize> + 'static, <Prev as Index<usize>>::Output: Sized + 'static,

§

type Value = <Prev as Index<usize>>::Output

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

impl<Inner, Prev, K, T> Write 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 + 'static,

§

type Value = <T as Index<usize>>::Output

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

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

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

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

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

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

§

type Value = <<S as StoreField>::Value as Deref>::Target

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

impl<T> Write for ArcField<T>

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

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

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

impl<T> Write for Field<T>

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

§

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

§

type Value = T

§

fn try_write(&self) -> Option<impl UntrackableGuard>

§

fn try_write_untracked(&self) -> Option<impl DerefMut>

Implementors§

§

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

§

type Value = Option<SendWrapper<<E as ElementType>::Output>>

§

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

§

type Value = Option<T>

§

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

§

type Value = Option<T>

§

impl<T> Write for ArcMappedSignal<T>
where T: 'static,

§

type Value = T

§

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

§

type Value = T

§

impl<T> Write for ArcWriteSignal<T>
where T: 'static,

§

type Value = T

§

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

§

type Value = Option<T>

§

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

§

type Value = T

§

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

§

type Value = Option<T>

§

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

§

type Value = T

§

impl<T, S> Write for WriteSignal<T, S>
where T: 'static, S: Storage<ArcWriteSignal<T>>,

§

type Value = T

§

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

§

type Value = Option<T>

§

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

§

type Value = Option<T>