pub struct MappedSignal<O: ?Sized + 'static, S: AnyStorage = UnsyncStorage> { /* private fields */ }
Expand description
A read only signal that has been mapped to a new type.
Trait Implementations§
Source§impl<O: ?Sized, S: AnyStorage> Clone for MappedSignal<O, S>
impl<O: ?Sized, S: AnyStorage> Clone for MappedSignal<O, S>
Source§impl<T: Debug + 'static, S: AnyStorage> Debug for MappedSignal<T, S>
impl<T: Debug + 'static, S: AnyStorage> Debug for MappedSignal<T, S>
Source§impl<O, S> Deref for MappedSignal<O, S>where
O: Clone,
S: AnyStorage + 'static,
Allow calling a signal with signal() syntax
impl<O, S> Deref for MappedSignal<O, S>where
O: Clone,
S: AnyStorage + 'static,
Allow calling a signal with signal() syntax
Currently only limited to copy types, though could probably specialize for string/arc/rc
Source§impl<T: Display + 'static, S: AnyStorage> Display for MappedSignal<T, S>
impl<T: Display + 'static, S: AnyStorage> Display for MappedSignal<T, S>
Source§impl<O, S> IntoAttributeValue for MappedSignal<O, S>
impl<O, S> IntoAttributeValue for MappedSignal<O, S>
Source§fn into_value(self) -> AttributeValue
fn into_value(self) -> AttributeValue
Convert into an attribute value
Source§impl<T: PartialEq + 'static, S: AnyStorage> PartialEq<T> for MappedSignal<T, S>
impl<T: PartialEq + 'static, S: AnyStorage> PartialEq<T> for MappedSignal<T, S>
Source§impl<O, S> PartialEq for MappedSignal<O, S>where
O: ?Sized,
S: AnyStorage,
impl<O, S> PartialEq for MappedSignal<O, S>where
O: ?Sized,
S: AnyStorage,
Source§impl<O, S> Readable for MappedSignal<O, S>where
O: ?Sized,
S: AnyStorage,
impl<O, S> Readable for MappedSignal<O, S>where
O: ?Sized,
S: AnyStorage,
Source§fn try_read_unchecked(&self) -> Result<ReadableRef<'static, Self>, BorrowError>
fn try_read_unchecked(&self) -> Result<ReadableRef<'static, Self>, BorrowError>
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>>
fn try_peek_unchecked(&self) -> BorrowResult<ReadableRef<'static, Self>>
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 map<O>(
self,
f: impl Fn(&Self::Target) -> &O + 'static,
) -> MappedSignal<O, Self::Storage>
fn map<O>( self, f: impl Fn(&Self::Target) -> &O + 'static, ) -> MappedSignal<O, Self::Storage>
Map the readable type to a new type. This lets you provide a view into a readable type without needing to clone the inner value. Read more
Source§fn read(&self) -> ReadableRef<'_, Self>
fn read(&self) -> ReadableRef<'_, Self>
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>
fn try_read(&self) -> Result<ReadableRef<'_, Self>, BorrowError>
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>
fn read_unchecked(&self) -> ReadableRef<'static, Self>
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>
fn peek(&self) -> ReadableRef<'_, Self>
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>
fn try_peek(&self) -> Result<ReadableRef<'_, Self>, BorrowError>
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>
fn peek_unchecked(&self) -> ReadableRef<'static, Self>
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 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) -> O
fn with<O>(&self, f: impl FnOnce(&Self::Target) -> O) -> O
Run a function with a reference to the value. If the value has been dropped, this will panic.
Auto Trait Implementations§
impl<O, S> Freeze for MappedSignal<O, S>where
O: ?Sized,
impl<O, S = UnsyncStorage> !RefUnwindSafe for MappedSignal<O, S>
impl<O, S = UnsyncStorage> !Send for MappedSignal<O, S>
impl<O, S = UnsyncStorage> !Sync for MappedSignal<O, S>
impl<O, S> Unpin for MappedSignal<O, S>where
O: ?Sized,
impl<O, S = UnsyncStorage> !UnwindSafe for MappedSignal<O, S>
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<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 as_ref(&self) -> Result<ReadableRef<'_, Self, T>, ReadableRef<'_, Self, E>>
fn as_ref(&self) -> Result<ReadableRef<'_, Self, T>, ReadableRef<'_, Self, E>>
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>>
fn first(&self) -> Option<ReadableRef<'_, Self, T>>
Get the first element of the inner vector.
Source§fn last(&self) -> Option<ReadableRef<'_, Self, T>>
fn last(&self) -> Option<ReadableRef<'_, Self, T>>
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.