pub struct WriteSignal<T, S = UnsyncStorage>where
S: BoxedSignalStorage<T>,
T: ?Sized,{ /* private fields */ }Available on crate feature
prelude only.Expand description
A boxed version of Writable that can be used to store any writable type.
Implementations§
Source§impl<T> WriteSignal<T>where
T: 'static + ?Sized,
impl<T> WriteSignal<T>where
T: 'static + ?Sized,
Sourcepub fn new(
value: impl Writable + 'static,
) -> WriteSignal<T>where
<impl Writable<Target = T, Storage = UnsyncStorage> + 'static as Writable>::WriteMetadata: 'static,
pub fn new(
value: impl Writable + 'static,
) -> WriteSignal<T>where
<impl Writable<Target = T, Storage = UnsyncStorage> + 'static as Writable>::WriteMetadata: 'static,
where
<impl Writable<Target = T, Storage = UnsyncStorage> + 'static as Writable>::WriteMetadata: 'static,
Create a new boxed writable value.
Source§impl<T, S> WriteSignal<T, S>where
T: 'static + ?Sized,
S: BoxedSignalStorage<T>,
impl<T, S> WriteSignal<T, S>where
T: 'static + ?Sized,
S: BoxedSignalStorage<T>,
Sourcepub fn new_maybe_sync<R>(value: R) -> WriteSignal<T, S>where
R: Writable<Target = T>,
<R as Writable>::WriteMetadata: 'static,
S: CreateBoxedSignalStorage<R>,
pub fn new_maybe_sync<R>(value: R) -> WriteSignal<T, S>where
R: Writable<Target = T>,
<R as Writable>::WriteMetadata: 'static,
S: CreateBoxedSignalStorage<R>,
Create a new boxed writable value which may be sync
Trait Implementations§
Source§impl<T, S> Add<T> for WriteSignal<T, S>
impl<T, S> Add<T> for WriteSignal<T, S>
Source§impl<T, S> AddAssign<T> for WriteSignal<T, S>
impl<T, S> AddAssign<T> for WriteSignal<T, S>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<T, S> Clone for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
impl<T, S> Clone for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
Source§fn clone(&self) -> WriteSignal<T, S>
fn clone(&self) -> WriteSignal<T, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, S> Debug for WriteSignal<T, S>where
T: Debug + 'static,
S: BoxedSignalStorage<T>,
impl<T, S> Debug for WriteSignal<T, S>where
T: Debug + 'static,
S: BoxedSignalStorage<T>,
Source§impl<T, S> Deref for WriteSignal<T, S>where
T: Clone + 'static,
S: BoxedSignalStorage<T>,
impl<T, S> Deref for WriteSignal<T, S>where
T: Clone + 'static,
S: BoxedSignalStorage<T>,
Source§impl<T, S> Display for WriteSignal<T, S>where
T: Display + 'static,
S: BoxedSignalStorage<T>,
impl<T, S> Display for WriteSignal<T, S>where
T: Display + 'static,
S: BoxedSignalStorage<T>,
Source§impl<T, S> Div<T> for WriteSignal<T, S>
impl<T, S> Div<T> for WriteSignal<T, S>
Source§impl<T, S> DivAssign<T> for WriteSignal<T, S>
impl<T, S> DivAssign<T> for WriteSignal<T, S>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T, S> From<CopyValue<T, S>> for WriteSignal<T, S>where
T: 'static,
S: CreateBoxedSignalStorage<CopyValue<T, S>> + BoxedSignalStorage<T> + Storage<T>,
impl<T, S> From<CopyValue<T, S>> for WriteSignal<T, S>where
T: 'static,
S: CreateBoxedSignalStorage<CopyValue<T, S>> + BoxedSignalStorage<T> + Storage<T>,
Source§fn from(value: CopyValue<T, S>) -> WriteSignal<T, S>
fn from(value: CopyValue<T, S>) -> WriteSignal<T, S>
Converts to this type from the input type.
Source§impl<T, R> From<Global<T, R>> for WriteSignal<R>where
T: Writable<Target = R, Storage = UnsyncStorage> + InitializeFromFunction<R> + Clone + 'static,
R: 'static,
impl<T, R> From<Global<T, R>> for WriteSignal<R>where
T: Writable<Target = R, Storage = UnsyncStorage> + InitializeFromFunction<R> + Clone + 'static,
R: 'static,
Source§fn from(value: Global<T, R>) -> WriteSignal<R>
fn from(value: Global<T, R>) -> WriteSignal<R>
Converts to this type from the input type.
Source§impl<V, O, F, FMut, S> From<MappedMutSignal<O, V, F, FMut>> for WriteSignal<O, S>where
O: 'static + ?Sized,
V: Writable<Storage = S> + 'static,
F: Fn(&<V as Readable>::Target) -> &O + 'static,
FMut: Fn(&mut <V as Readable>::Target) -> &mut O + 'static,
S: CreateBoxedSignalStorage<MappedMutSignal<O, V, F, FMut>> + BoxedSignalStorage<O>,
impl<V, O, F, FMut, S> From<MappedMutSignal<O, V, F, FMut>> for WriteSignal<O, S>where
O: 'static + ?Sized,
V: Writable<Storage = S> + 'static,
F: Fn(&<V as Readable>::Target) -> &O + 'static,
FMut: Fn(&mut <V as Readable>::Target) -> &mut O + 'static,
S: CreateBoxedSignalStorage<MappedMutSignal<O, V, F, FMut>> + BoxedSignalStorage<O>,
Source§fn from(value: MappedMutSignal<O, V, F, FMut>) -> WriteSignal<O, S>
fn from(value: MappedMutSignal<O, V, F, FMut>) -> WriteSignal<O, S>
Converts to this type from the input type.
Source§impl<T, S> From<Signal<T, S>> for WriteSignal<T, S>where
T: 'static,
S: CreateBoxedSignalStorage<Signal<T, S>> + BoxedSignalStorage<T> + Storage<SignalData<T>>,
impl<T, S> From<Signal<T, S>> for WriteSignal<T, S>where
T: 'static,
S: CreateBoxedSignalStorage<Signal<T, S>> + BoxedSignalStorage<T> + Storage<SignalData<T>>,
Source§fn from(value: Signal<T, S>) -> WriteSignal<T, S>
fn from(value: Signal<T, S>) -> WriteSignal<T, S>
Converts to this type from the input type.
Source§impl<T, S> From<WriteSignal<T, S>> for ReadSignal<T, S>
impl<T, S> From<WriteSignal<T, S>> for ReadSignal<T, S>
Source§fn from(value: WriteSignal<T, S>) -> ReadSignal<T, S>
fn from(value: WriteSignal<T, S>) -> ReadSignal<T, S>
Converts to this type from the input type.
Source§impl<T, S> IntoAttributeValue for WriteSignal<T, S>
impl<T, S> IntoAttributeValue for WriteSignal<T, S>
Source§fn into_value(self) -> AttributeValue
fn into_value(self) -> AttributeValue
Convert into an attribute value
Source§impl<T, S> IntoDynNode for WriteSignal<T, S>
impl<T, S> IntoDynNode for WriteSignal<T, S>
Source§fn into_dyn_node(self) -> DynamicNode
fn into_dyn_node(self) -> DynamicNode
Consume this item and produce a DynamicNode
Source§impl<T, S> Mul<T> for WriteSignal<T, S>
impl<T, S> Mul<T> for WriteSignal<T, S>
Source§impl<T, S> MulAssign<T> for WriteSignal<T, S>
impl<T, S> MulAssign<T> for WriteSignal<T, S>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T, S> PartialEq<T> for WriteSignal<T, S>where
T: PartialEq + 'static,
S: BoxedSignalStorage<T>,
impl<T, S> PartialEq<T> for WriteSignal<T, S>where
T: PartialEq + 'static,
S: BoxedSignalStorage<T>,
Source§impl<T, S> PartialEq for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
impl<T, S> PartialEq for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
Source§impl<T, S> Readable for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
impl<T, S> Readable for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
Source§fn try_read_unchecked(
&self,
) -> Result<<<WriteSignal<T, S> as Readable>::Storage as AnyStorage>::Ref<'static, <WriteSignal<T, S> as Readable>::Target>, BorrowError>where
T: 'static,
fn try_read_unchecked(
&self,
) -> Result<<<WriteSignal<T, S> as Readable>::Storage as AnyStorage>::Ref<'static, <WriteSignal<T, S> as Readable>::Target>, BorrowError>where
T: 'static,
Try to get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal. Read more
Source§fn try_peek_unchecked(
&self,
) -> Result<<<WriteSignal<T, S> as Readable>::Storage as AnyStorage>::Ref<'static, <WriteSignal<T, S> as Readable>::Target>, BorrowError>where
T: 'static,
fn try_peek_unchecked(
&self,
) -> Result<<<WriteSignal<T, S> as Readable>::Storage as AnyStorage>::Ref<'static, <WriteSignal<T, S> as Readable>::Target>, BorrowError>where
T: 'static,
Try to peek the current value of the signal without subscribing to updates. If the value has
been dropped, this will return an error. Read more
Source§fn subscribers(&self) -> Subscriberswhere
T: 'static,
fn subscribers(&self) -> Subscriberswhere
T: 'static,
Get the underlying subscriber list for this readable. This is used to track when the value changes and notify subscribers.
Source§impl<T, S> Sub<T> for WriteSignal<T, S>
impl<T, S> Sub<T> for WriteSignal<T, S>
Source§impl<T, S> SubAssign<T> for WriteSignal<T, S>
impl<T, S> SubAssign<T> for WriteSignal<T, S>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-= operation. Read moreSource§impl<T, S> Writable for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
impl<T, S> Writable for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
Source§type WriteMetadata = Box<dyn Any>
type WriteMetadata = Box<dyn Any>
Additional data associated with the write reference.
Source§fn try_write_unchecked(
&self,
) -> Result<WriteLock<'static, <WriteSignal<T, S> as Readable>::Target, <WriteSignal<T, S> as Readable>::Storage, <WriteSignal<T, S> as Writable>::WriteMetadata>, BorrowMutError>where
T: 'static,
fn try_write_unchecked(
&self,
) -> Result<WriteLock<'static, <WriteSignal<T, S> as Readable>::Target, <WriteSignal<T, S> as Readable>::Storage, <WriteSignal<T, S> as Writable>::WriteMetadata>, BorrowMutError>where
T: 'static,
Try to get a mutable reference to the value without checking the lifetime. This will update any subscribers. Read more
impl<T, S> Copy for WriteSignal<T, S>where
S: BoxedSignalStorage<T>,
T: ?Sized,
Auto Trait Implementations§
impl<T, S> Freeze for WriteSignal<T, S>where
T: ?Sized,
impl<T, S> RefUnwindSafe for WriteSignal<T, S>where
S: RefUnwindSafe,
<S as BoxedSignalStorage<T>>::DynWritable<SealedToken>: RefUnwindSafe,
T: ?Sized,
impl<T, S> Send for WriteSignal<T, S>
impl<T, S> Sync for WriteSignal<T, S>
impl<T, S> Unpin for WriteSignal<T, S>where
T: ?Sized,
impl<T, S> UnwindSafe for WriteSignal<T, S>where
S: RefUnwindSafe,
<S as BoxedSignalStorage<T>>::DynWritable<SealedToken>: UnwindSafe,
T: ?Sized,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> ReadableBoxExt for R
impl<R> ReadableBoxExt for R
Source§impl<R> ReadableExt for R
impl<R> ReadableExt for R
Source§fn read(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
fn read(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
Get the current value of the state. If this is a signal, this will subscribe the current scope to the signal.
If the value has been dropped, this will panic. Calling this on a Signal is the same as
using the signal() syntax to read and subscribe to its value
Source§fn try_read(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
fn try_read(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
Try to get the current value of the state. If this is a signal, this will subscribe the current scope to the signal.
Source§fn read_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
fn read_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
Get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal. Read more
Source§fn peek(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
fn peek(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
Get the current value of the state without subscribing to updates. If the value has been dropped, this will panic. Read more
Source§fn try_peek(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
fn try_peek(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
Try to peek the current value of the signal without subscribing to updates. If the value has
been dropped, this will return an error.
Source§fn peek_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
fn peek_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
Get the current value of the signal without checking the lifetime. Unlike read, this will not subscribe the current scope to the signal which can cause parts of your UI to not update. Read more
Source§fn map<F, O>(self, f: F) -> MappedSignal<O, Self, F>
fn map<F, O>(self, f: F) -> MappedSignal<O, Self, F>
Map the references of the readable value to a new type. This lets you provide a view
into the readable value without creating a new signal or cloning the value. Read more
Source§fn cloned(&self) -> Self::Target
fn cloned(&self) -> Self::Target
Clone the inner value and return it. If the value has been dropped, this will panic.
Source§fn with<O>(&self, f: impl FnOnce(&Self::Target) -> O) -> Owhere
Self::Target: 'static,
fn with<O>(&self, f: impl FnOnce(&Self::Target) -> O) -> Owhere
Self::Target: 'static,
Run a function with a reference to the value. If the value has been dropped, this will panic.
Source§impl<K, V, H, R> ReadableHashMapExt<K, V, H> for R
impl<K, V, H, R> ReadableHashMapExt<K, V, H> for R
Source§impl<V, H, R> ReadableHashSetExt<V, H> for R
impl<V, H, R> ReadableHashSetExt<V, H> for R
Source§impl<T, R> ReadableOptionExt<T> for R
impl<T, R> ReadableOptionExt<T> for R
Source§impl<T, E, R> ReadableResultExt<T, E> for R
impl<T, E, R> ReadableResultExt<T, E> for R
Source§fn unwrap(&self) -> Twhere
T: Clone + 'static,
E: 'static,
fn unwrap(&self) -> Twhere
T: Clone + 'static,
E: 'static,
Unwraps the inner value and clones it.
Source§fn as_ref(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, T>, <Self::Storage as AnyStorage>::Ref<'_, E>>where
T: 'static,
E: 'static,
fn as_ref(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, T>, <Self::Storage as AnyStorage>::Ref<'_, E>>where
T: 'static,
E: 'static,
Attempts to read the inner value of the Option.
Source§impl<W> ReadableStringExt for W
impl<W> ReadableStringExt for W
Source§impl<T, R> ReadableVecExt<T> for R
impl<T, R> ReadableVecExt<T> for R
Source§fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
Get the first element of the inner vector.
Source§fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
Get the last element of the inner vector.
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WritableBoxedExt for Twhere
T: Writable<Storage = UnsyncStorage> + 'static,
impl<T> WritableBoxedExt for Twhere
T: Writable<Storage = UnsyncStorage> + 'static,
Source§impl<W> WritableExt for W
impl<W> WritableExt for W
Source§fn write(
&mut self,
) -> WriteLock<'_, Self::Target, Self::Storage, Self::WriteMetadata>where
Self::Target: 'static,
fn write(
&mut self,
) -> WriteLock<'_, Self::Target, Self::Storage, Self::WriteMetadata>where
Self::Target: 'static,
Get a mutable reference to the value. If the value has been dropped, this will panic.
Source§fn try_write(
&mut self,
) -> Result<WriteLock<'_, Self::Target, Self::Storage, Self::WriteMetadata>, BorrowMutError>where
Self::Target: 'static,
fn try_write(
&mut self,
) -> Result<WriteLock<'_, Self::Target, Self::Storage, Self::WriteMetadata>, BorrowMutError>where
Self::Target: 'static,
Try to get a mutable reference to the value.
Source§fn write_unchecked(
&self,
) -> WriteLock<'static, Self::Target, Self::Storage, Self::WriteMetadata>where
Self::Target: 'static,
fn write_unchecked(
&self,
) -> WriteLock<'static, Self::Target, Self::Storage, Self::WriteMetadata>where
Self::Target: 'static,
Get a mutable reference to the value without checking the lifetime. This will update any subscribers. Read more
Source§fn map_mut<O, F, FMut>(
self,
f: F,
f_mut: FMut,
) -> MappedMutSignal<O, Self, F, FMut>
fn map_mut<O, F, FMut>( self, f: F, f_mut: FMut, ) -> MappedMutSignal<O, Self, F, FMut>
Map the references and mutable references of the writable value to a new type. This lets you provide a view
into the writable value without creating a new signal or cloning the value. Read more
Source§fn with_mut<O>(&mut self, f: impl FnOnce(&mut Self::Target) -> O) -> Owhere
Self::Target: 'static,
fn with_mut<O>(&mut self, f: impl FnOnce(&mut Self::Target) -> O) -> Owhere
Self::Target: 'static,
Run a function with a mutable reference to the value. If the value has been dropped, this will panic.
Source§fn set(&mut self, value: Self::Target)
fn set(&mut self, value: Self::Target)
Set the value of the signal. This will trigger an update on all subscribers.
Source§fn toggle(&mut self)
fn toggle(&mut self)
Invert the boolean value of the signal. This will trigger an update on all subscribers.
Source§fn index_mut<I>(
&mut self,
index: I,
) -> WriteLock<'_, <Self::Target as Index<I>>::Output, Self::Storage, Self::WriteMetadata>
fn index_mut<I>( &mut self, index: I, ) -> WriteLock<'_, <Self::Target as Index<I>>::Output, Self::Storage, Self::WriteMetadata>
Index into the inner value and return a reference to the result.
Source§impl<K, V, H, R> WritableHashMapExt<K, V, H> for R
impl<K, V, H, R> WritableHashMapExt<K, V, H> for R
Source§fn retain(&mut self, f: impl FnMut(&K, &mut V) -> bool)
fn retain(&mut self, f: impl FnMut(&K, &mut V) -> bool)
Retains only the key-value pairs that match the given predicate.
Source§fn insert(&mut self, k: K, v: V) -> Option<V>
fn insert(&mut self, k: K, v: V) -> Option<V>
Inserts a key-value pair into the map. If the key was already present, the old value is returned.
Source§fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)
fn extend(&mut self, iter: impl IntoIterator<Item = (K, V)>)
Extends the map with the key-value pairs from the given iterator.
Source§impl<V, H, R> WritableHashSetExt<V, H> for R
impl<V, H, R> WritableHashSetExt<V, H> for R
Source§fn retain(&mut self, f: impl FnMut(&V) -> bool)
fn retain(&mut self, f: impl FnMut(&V) -> bool)
Retain only the elements specified by the predicate.
Source§fn insert(&mut self, k: V) -> bool
fn insert(&mut self, k: V) -> bool
Inserts a value into the set. Returns true if the value was not already present.
Source§fn extend(&mut self, iter: impl IntoIterator<Item = V>)
fn extend(&mut self, iter: impl IntoIterator<Item = V>)
Extends the set with the values from the given iterator.
Source§impl<T, W> WritableOptionExt<T> for W
impl<T, W> WritableOptionExt<T> for W
Source§fn get_or_insert(
&mut self,
default: T,
) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>where
T: 'static,
fn get_or_insert(
&mut self,
default: T,
) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>where
T: 'static,
Gets the value out of the Option, or inserts the given value if the Option is empty.
Source§fn get_or_insert_with(
&mut self,
default: impl FnOnce() -> T,
) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>where
T: 'static,
fn get_or_insert_with(
&mut self,
default: impl FnOnce() -> T,
) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>where
T: 'static,
Gets the value out of the Option, or inserts the value returned by the given function if the Option is empty.
Source§impl<W> WritableStringExt for W
impl<W> WritableStringExt for W
Source§fn insert_str(&mut self, idx: usize, s: &str)
fn insert_str(&mut self, idx: usize, s: &str)
Inserts a string at the given index.
Source§fn replace_range(&mut self, range: impl RangeBounds<usize>, replace_with: &str)
fn replace_range(&mut self, range: impl RangeBounds<usize>, replace_with: &str)
Replace a range of the string with the given string.
Source§fn extend(&mut self, iter: impl IntoIterator<Item = char>)
fn extend(&mut self, iter: impl IntoIterator<Item = char>)
Extends the string with the given iterator of characters.
Source§impl<W, T> WritableVecExt<T> for W
impl<W, T> WritableVecExt<T> for W
Source§fn insert(&mut self, index: usize, value: T)where
T: 'static,
fn insert(&mut self, index: usize, value: T)where
T: 'static,
Inserts a new value at the given index.
Source§fn remove(&mut self, index: usize) -> Twhere
T: 'static,
fn remove(&mut self, index: usize) -> Twhere
T: 'static,
Removes the value at the given index.
Source§fn extend(&mut self, iter: impl IntoIterator<Item = T>)where
T: 'static,
fn extend(&mut self, iter: impl IntoIterator<Item = T>)where
T: 'static,
Extends the vector with the given iterator.
Source§fn swap_remove(&mut self, index: usize) -> Twhere
T: 'static,
fn swap_remove(&mut self, index: usize) -> Twhere
T: 'static,
Swaps two values in the vector.
Source§fn retain(&mut self, f: impl FnMut(&T) -> bool)where
T: 'static,
fn retain(&mut self, f: impl FnMut(&T) -> bool)where
T: 'static,
Retains only the values that match the given predicate.
Source§fn split_off(&mut self, at: usize) -> Vec<T>where
T: 'static,
fn split_off(&mut self, at: usize) -> Vec<T>where
T: 'static,
Splits the vector into two at the given index.