pub struct MappedMutSignal<O: ?Sized, V, F = fn(&<V as Readable>::Target) -> &O, FMut = fn(&mut <V as Readable>::Target) -> &mut O> { /* private fields */ }
Expand description
A read only signal that has been mapped to a new type.
Implementations§
Trait Implementations§
Source§impl<T: Add<Output = T> + Copy + 'static, V, F, FMut> Add<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Add<Output = T> + Copy + 'static, V, F, FMut> Add<T> for MappedMutSignal<T, V, F, FMut>
Source§impl<T: Add<Output = T> + Copy + 'static, V, F, FMut> AddAssign<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Add<Output = T> + Copy + 'static, V, F, FMut> AddAssign<T> for MappedMutSignal<T, V, F, FMut>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+=
operation. Read moreSource§impl<V, O, F, FMut> Clone for MappedMutSignal<O, V, F, FMut>
impl<V, O, F, FMut> Clone for MappedMutSignal<O, V, F, FMut>
Source§impl<T: Debug + 'static, V, F, FMut> Debug for MappedMutSignal<T, V, F, FMut>
impl<T: Debug + 'static, V, F, FMut> Debug for MappedMutSignal<T, V, F, FMut>
Source§impl<V, O, F, FMut> Deref for MappedMutSignal<O, V, F, FMut>
Allow calling a signal with signal() syntax
impl<V, O, F, FMut> Deref for MappedMutSignal<O, V, F, FMut>
Allow calling a signal with signal() syntax
Currently only limited to clone types, though could probably specialize for string/arc/rc
Source§impl<T: Display + 'static, V, F, FMut> Display for MappedMutSignal<T, V, F, FMut>
impl<T: Display + 'static, V, F, FMut> Display for MappedMutSignal<T, V, F, FMut>
Source§impl<T: Div<Output = T> + Copy + 'static, V, F, FMut> Div<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Div<Output = T> + Copy + 'static, V, F, FMut> Div<T> for MappedMutSignal<T, V, F, FMut>
Source§impl<T: Div<Output = T> + Copy + 'static, V, F, FMut> DivAssign<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Div<Output = T> + Copy + 'static, V, F, FMut> DivAssign<T> for MappedMutSignal<T, V, F, FMut>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moreSource§impl<V, O, F, FMut> From<MappedMutSignal<O, V, F, FMut>> for ReadSignal<O>
impl<V, O, F, FMut> From<MappedMutSignal<O, V, F, FMut>> for ReadSignal<O>
Source§fn from(value: MappedMutSignal<O, V, F, FMut>) -> Self
fn from(value: MappedMutSignal<O, V, F, FMut>) -> Self
Converts to this type from the input type.
Source§impl<V, O, F, FMut> From<MappedMutSignal<O, V, F, FMut>> for WriteSignal<O>
impl<V, O, F, FMut> From<MappedMutSignal<O, V, F, FMut>> for WriteSignal<O>
Source§fn from(value: MappedMutSignal<O, V, F, FMut>) -> Self
fn from(value: MappedMutSignal<O, V, F, FMut>) -> Self
Converts to this type from the input type.
Source§impl<V, O, F, FMut> IntoAttributeValue for MappedMutSignal<O, V, F, FMut>
impl<V, O, F, FMut> IntoAttributeValue for MappedMutSignal<O, V, F, FMut>
Source§fn into_value(self) -> AttributeValue
fn into_value(self) -> AttributeValue
Convert into an attribute value
Source§impl<T: Mul<Output = T> + Copy + 'static, V, F, FMut> Mul<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Mul<Output = T> + Copy + 'static, V, F, FMut> Mul<T> for MappedMutSignal<T, V, F, FMut>
Source§impl<T: Mul<Output = T> + Copy + 'static, V, F, FMut> MulAssign<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Mul<Output = T> + Copy + 'static, V, F, FMut> MulAssign<T> for MappedMutSignal<T, V, F, FMut>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moreSource§impl<T: PartialEq + 'static, V, F, FMut> PartialEq<T> for MappedMutSignal<T, V, F, FMut>
impl<T: PartialEq + 'static, V, F, FMut> PartialEq<T> for MappedMutSignal<T, V, F, FMut>
Source§impl<V, O, F, FMut> PartialEq for MappedMutSignal<O, V, F, FMut>
impl<V, O, F, FMut> PartialEq for MappedMutSignal<O, V, F, FMut>
Source§impl<V, O, F, FMut> Readable for MappedMutSignal<O, V, F, FMut>
impl<V, O, F, FMut> Readable for MappedMutSignal<O, V, F, FMut>
Source§fn try_read_unchecked(&self) -> Result<ReadableRef<'static, Self>, BorrowError>where
O: 'static,
fn try_read_unchecked(&self) -> Result<ReadableRef<'static, Self>, BorrowError>where
O: '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) -> BorrowResult<ReadableRef<'static, Self>>where
O: 'static,
fn try_peek_unchecked(&self) -> BorrowResult<ReadableRef<'static, Self>>where
O: '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
O: 'static,
fn subscribers(&self) -> Subscriberswhere
O: 'static,
Get the underlying subscriber list for this readable. This is used to track when the value changes and notify subscribers.
Source§impl<T: Sub<Output = T> + Copy + 'static, V, F, FMut> Sub<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Sub<Output = T> + Copy + 'static, V, F, FMut> Sub<T> for MappedMutSignal<T, V, F, FMut>
Source§impl<T: Sub<Output = T> + Copy + 'static, V, F, FMut> SubAssign<T> for MappedMutSignal<T, V, F, FMut>
impl<T: Sub<Output = T> + Copy + 'static, V, F, FMut> SubAssign<T> for MappedMutSignal<T, V, F, FMut>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-=
operation. Read moreSource§impl<V, O, F, FMut> Writable for MappedMutSignal<O, V, F, FMut>
impl<V, O, F, FMut> Writable for MappedMutSignal<O, V, F, FMut>
Source§type WriteMetadata = <V as Writable>::WriteMetadata
type WriteMetadata = <V as Writable>::WriteMetadata
Additional data associated with the write reference.
Source§fn try_write_unchecked(
&self,
) -> Result<WritableRef<'static, Self>, BorrowMutError>
fn try_write_unchecked( &self, ) -> Result<WritableRef<'static, Self>, BorrowMutError>
Try to get a mutable reference to the value without checking the lifetime. This will update any subscribers. Read more
impl<V, O, F, FMut> Copy for MappedMutSignal<O, V, F, FMut>
Auto Trait Implementations§
impl<O, V, F, FMut> Freeze for MappedMutSignal<O, V, F, FMut>
impl<O, V, F, FMut> RefUnwindSafe for MappedMutSignal<O, V, F, FMut>
impl<O, V, F, FMut> Send for MappedMutSignal<O, V, F, FMut>
impl<O, V, F, FMut> Sync for MappedMutSignal<O, V, F, FMut>
impl<O, V, F, FMut> Unpin for MappedMutSignal<O, V, F, FMut>
impl<O, V, F, FMut> UnwindSafe for MappedMutSignal<O, V, F, FMut>
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> 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<R> ReadableBoxExt for R
impl<R> ReadableBoxExt for R
Source§impl<R> ReadableExt for R
impl<R> ReadableExt for R
Source§fn read(&self) -> ReadableRef<'_, Self>where
Self::Target: 'static,
fn read(&self) -> ReadableRef<'_, Self>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<ReadableRef<'_, Self>, BorrowError>where
Self::Target: 'static,
fn try_read(&self) -> Result<ReadableRef<'_, Self>, 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) -> ReadableRef<'static, Self>where
Self::Target: 'static,
fn read_unchecked(&self) -> ReadableRef<'static, Self>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) -> ReadableRef<'_, Self>where
Self::Target: 'static,
fn peek(&self) -> ReadableRef<'_, Self>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<ReadableRef<'_, Self>, BorrowError>where
Self::Target: 'static,
fn try_peek(&self) -> Result<ReadableRef<'_, Self>, 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) -> ReadableRef<'static, Self>where
Self::Target: 'static,
fn peek_unchecked(&self) -> ReadableRef<'static, Self>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<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<ReadableRef<'_, Self, T>, ReadableRef<'_, Self, E>>where
T: 'static,
E: 'static,
fn as_ref(&self) -> Result<ReadableRef<'_, Self, T>, ReadableRef<'_, Self, E>>where
T: 'static,
E: 'static,
Attempts to read the inner value of the Option.
Source§impl<T, R> ReadableVecExt<T> for R
impl<T, R> ReadableVecExt<T> for R
Source§fn first(&self) -> Option<ReadableRef<'_, Self, T>>where
T: 'static,
fn first(&self) -> Option<ReadableRef<'_, Self, T>>where
T: 'static,
Get the first element of the inner vector.
Source§fn last(&self) -> Option<ReadableRef<'_, Self, T>>where
T: 'static,
fn last(&self) -> Option<ReadableRef<'_, Self, 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> 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) -> WritableRef<'_, Self>where
Self::Target: 'static,
fn write(&mut self) -> WritableRef<'_, Self>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<WritableRef<'_, Self>, BorrowMutError>where
Self::Target: 'static,
fn try_write(&mut self) -> Result<WritableRef<'_, Self>, BorrowMutError>where
Self::Target: 'static,
Try to get a mutable reference to the value.
Source§fn write_unchecked(&self) -> WritableRef<'static, Self>where
Self::Target: 'static,
fn write_unchecked(&self) -> WritableRef<'static, Self>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,
) -> WritableRef<'_, Self, <Self::Target as Index<I>>::Output>
fn index_mut<I>( &mut self, index: I, ) -> WritableRef<'_, Self, <Self::Target as Index<I>>::Output>
Index into the inner value and return a reference to the result.
Source§impl<T, W> WritableOptionExt<T> for W
impl<T, W> WritableOptionExt<T> for W
Source§fn get_or_insert(&mut self, default: T) -> WritableRef<'_, Self, T>where
T: 'static,
fn get_or_insert(&mut self, default: T) -> WritableRef<'_, Self, T>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,
) -> WritableRef<'_, Self, T>where
T: 'static,
fn get_or_insert_with(
&mut self,
default: impl FnOnce() -> T,
) -> WritableRef<'_, Self, T>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§fn as_mut(&mut self) -> Option<WritableRef<'_, Self, T>>where
T: 'static,
fn as_mut(&mut self) -> Option<WritableRef<'_, Self, T>>where
T: 'static,
Attempts to write the inner value of the Option.
Source§impl<T, W> WritableVecExt<T> for W
impl<T, W> 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.