Type Alias freya_hooks::ReadAnimatedValue

source ·
pub type ReadAnimatedValue = ReadOnlySignal<Box<dyn AnimatedValue>>;

Aliased Type§

struct ReadAnimatedValue { /* private fields */ }

Implementations

§

impl<T> ReadOnlySignal<T>
where T: 'static,

pub fn new(signal: Signal<T>) -> ReadOnlySignal<T>

Create a new read-only signal.

§

impl<T, S> ReadOnlySignal<T, S>
where T: 'static, S: Storage<SignalData<T>>,

pub fn new_maybe_sync(signal: Signal<T, S>) -> ReadOnlySignal<T, S>

Create a new read-only signal that is maybe sync.

pub fn origin_scope(&self) -> ScopeId

Get the scope that the signal was created in.

pub fn id(&self) -> GenerationalBoxId

Get the id of the signal.

Trait Implementations

§

impl<T, S> Clone for ReadOnlySignal<T, S>
where T: 'static, S: Storage<SignalData<T>>,

§

fn clone(&self) -> ReadOnlySignal<T, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T, S> Debug for ReadOnlySignal<T, S>
where T: Debug + 'static, S: Storage<SignalData<T>>,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T, S> Default for ReadOnlySignal<T, S>
where T: Default + 'static, S: Storage<SignalData<T>>,

§

fn default() -> ReadOnlySignal<T, S>

Returns the “default value” for a type. Read more
§

impl<T, S> Deref for ReadOnlySignal<T, S>
where T: Clone, S: Storage<SignalData<T>> + 'static,

§

type Target = dyn Fn() -> T

The resulting type after dereferencing.
§

fn deref(&self) -> &<ReadOnlySignal<T, S> as Deref>::Target

Dereferences the value.
§

impl<T, S> Display for ReadOnlySignal<T, S>
where T: Display + 'static, S: Storage<SignalData<T>>,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> From<Memo<T>> for ReadOnlySignal<T>
where T: PartialEq,

§

fn from(val: Memo<T>) -> ReadOnlySignal<T>

Converts to this type from the input type.
§

impl<T, S> From<Signal<T, S>> for ReadOnlySignal<T, S>
where T: 'static, S: Storage<SignalData<T>>,

§

fn from(inner: Signal<T, S>) -> ReadOnlySignal<T, S>

Converts to this type from the input type.
§

impl<T> IntoAttributeValue for ReadOnlySignal<T>
where T: Clone + IntoAttributeValue,

§

fn into_value(self) -> AttributeValue

Convert into an attribute value
§

impl<T> IntoDynNode for ReadOnlySignal<T>
where T: Clone + IntoDynNode,

§

fn into_dyn_node(self) -> DynamicNode

Consume this item along with a scopestate and produce a DynamicNode Read more
§

impl<T, S> PartialEq<T> for ReadOnlySignal<T, S>
where T: PartialEq + 'static, S: Storage<SignalData<T>>,

§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T, S> PartialEq for ReadOnlySignal<T, S>
where T: 'static, S: Storage<SignalData<T>>,

§

fn eq(&self, other: &ReadOnlySignal<T, S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T, S> Readable for ReadOnlySignal<T, S>
where S: Storage<SignalData<T>>,

§

fn peek_unchecked(&self) -> <S as AnyStorage>::Ref<'static, T>

Get the current value of the signal. Unlike read, this will not subscribe the current scope to the signal which can cause parts of your UI to not update.

If the signal has been dropped, this will panic.

§

type Target = T

The target type of the reference.
§

type Storage = S

The type of the storage this readable uses.
§

fn try_read_unchecked( &self, ) -> Result<<<ReadOnlySignal<T, S> as Readable>::Storage as AnyStorage>::Ref<'static, <ReadOnlySignal<T, S> as Readable>::Target>, BorrowError>

Try to get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal. Read more
§

fn map<O>( self, f: impl Fn(&Self::Target) -> &O + 'static, ) -> MappedSignal<O, Self::Storage>
where Self: Sized + Clone + 'static,

Map the readable type to a new type.
§

fn read(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>

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
§

fn try_read( &self, ) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>

Try to get the current value of the state. If this is a signal, this will subscribe the current scope to the signal.
§

fn read_unchecked( &self, ) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>

Get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal. Read more
§

fn peek(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>

Get the current value of the state without subscribing to updates. If the value has been dropped, this will panic.
§

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

fn with_peek<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.
§

fn index<I>( &self, index: I, ) -> <Self::Storage as AnyStorage>::Ref<'_, <Self::Target as Index<I>>::Output>
where Self::Target: Index<I>,

Index into the inner value and return a reference to the result. If the value has been dropped or the index is invalid, this will panic.
§

impl<T, S> Copy for ReadOnlySignal<T, S>
where T: 'static, S: Storage<SignalData<T>>,