Struct StoredValue
pub struct StoredValue<T, S = SyncStorage> {
value: ArenaItem<ArcStoredValue<T>, S>,
}Expand description
A non-reactive, Copy handle for any value.
This allows you to create a stable reference for any value by storing it within
the reactive system. Like the signal types (e.g., ReadSignal
and RwSignal), it is Copy and 'static. Unlike the signal
types, it is not reactive; accessing it does not cause effects to subscribe, and
updating it does not notify anything else.
Fieldsยง
ยงvalue: ArenaItem<ArcStoredValue<T>, S>Implementationsยง
ยงimpl<T, S> StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
impl<T, S> StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
pub fn new_with_storage(value: T) -> StoredValue<T, S>
pub fn new_with_storage(value: T) -> StoredValue<T, S>
Stores the given value in the arena allocator.
ยงimpl<T> StoredValue<T>
impl<T> StoredValue<T>
pub fn new(value: T) -> StoredValue<T>
pub fn new(value: T) -> StoredValue<T>
Stores the given value in the arena allocator.
ยงimpl<T> StoredValue<T, LocalStorage>where
T: 'static,
impl<T> StoredValue<T, LocalStorage>where
T: 'static,
pub fn new_local(value: T) -> StoredValue<T, LocalStorage>
pub fn new_local(value: T) -> StoredValue<T, LocalStorage>
Stores the given value in the arena allocator.
Trait Implementationsยง
ยงimpl<T, S> Clone for StoredValue<T, S>
impl<T, S> Clone for StoredValue<T, S>
ยงfn clone(&self) -> StoredValue<T, S>
fn clone(&self) -> StoredValue<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 moreยงimpl<T, S> Debug for StoredValue<T, S>where
S: Debug,
impl<T, S> Debug for StoredValue<T, S>where
S: Debug,
ยงimpl<T, S> Default for StoredValue<T, S>
impl<T, S> Default for StoredValue<T, S>
ยงfn default() -> StoredValue<T, S>
fn default() -> StoredValue<T, S>
Returns the โdefault valueโ for a type. Read more
ยงimpl<T, S> DefinedAt for StoredValue<T, S>
impl<T, S> DefinedAt for StoredValue<T, S>
ยงfn defined_at(&self) -> Option<&'static Location<'static>>
fn defined_at(&self) -> Option<&'static Location<'static>>
Returns the location at which the signal was defined. This is usually simply
None in
release mode.ยงimpl<T> From<ArcStoredValue<T>> for StoredValue<T>
impl<T> From<ArcStoredValue<T>> for StoredValue<T>
ยงfn from(value: ArcStoredValue<T>) -> StoredValue<T>
fn from(value: ArcStoredValue<T>) -> StoredValue<T>
Converts to this type from the input type.
ยงimpl<T, S> From<StoredValue<T, S>> for ArcStoredValue<T>where
S: Storage<ArcStoredValue<T>>,
impl<T, S> From<StoredValue<T, S>> for ArcStoredValue<T>where
S: Storage<ArcStoredValue<T>>,
ยงfn from(value: StoredValue<T, S>) -> ArcStoredValue<T>
fn from(value: StoredValue<T, S>) -> ArcStoredValue<T>
Converts to this type from the input type.
ยงimpl<T, S> Hash for StoredValue<T, S>
impl<T, S> Hash for StoredValue<T, S>
ยงimpl<T, S> IntoInner for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
impl<T, S> IntoInner for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
ยงfn into_inner(self) -> Option<<StoredValue<T, S> as IntoInner>::Value>
fn into_inner(self) -> Option<<StoredValue<T, S> as IntoInner>::Value>
Returns the inner value if this is the only reference to the signal.
Otherwise, returns
None and drops this reference. Read moreยงimpl<T, S> IsDisposed for StoredValue<T, S>
impl<T, S> IsDisposed for StoredValue<T, S>
ยงfn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
If
true, the signal cannot be accessed without a panic.ยงimpl<T, S> PartialEq for StoredValue<T, S>
impl<T, S> PartialEq for StoredValue<T, S>
ยงimpl<T, S> ReadValue for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
impl<T, S> ReadValue for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
ยงtype Value = ReadGuard<T, Plain<T>>
type Value = ReadGuard<T, Plain<T>>
The guard type that will be returned, which can be dereferenced to the value.
ยงfn try_read_value(&self) -> Option<ReadGuard<T, Plain<T>>>
fn try_read_value(&self) -> Option<ReadGuard<T, Plain<T>>>
Returns the non-reactive guard, or
None if the value has already been disposed.ยงfn read_value(&self) -> Self::Value
fn read_value(&self) -> Self::Value
Returns the non-reactive guard. Read more
ยงimpl<T, S> WriteValue for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
impl<T, S> WriteValue for StoredValue<T, S>where
T: 'static,
S: Storage<ArcStoredValue<T>>,
ยงfn try_write_value(&self) -> Option<UntrackedWriteGuard<T>>
fn try_write_value(&self) -> Option<UntrackedWriteGuard<T>>
Returns a non-reactive write guard, or
None if the value has already been disposed.ยงfn write_value(&self) -> UntrackedWriteGuard<Self::Value>
fn write_value(&self) -> UntrackedWriteGuard<Self::Value>
Returns a non-reactive write guard. Read more
impl<T, S> Copy for StoredValue<T, S>
impl<T, S> Eq for StoredValue<T, S>
Auto Trait Implementationsยง
impl<T, S> Freeze for StoredValue<T, S>
impl<T, S> RefUnwindSafe for StoredValue<T, S>
impl<T, S> Send for StoredValue<T, S>
impl<T, S> Sync for StoredValue<T, S>
impl<T, S> Unpin for StoredValue<T, S>
impl<T, S> UnwindSafe for StoredValue<T, S>
Blanket Implementationsยง
Sourceยงimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Sourceยงfn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Convert the source color to the destination color using the specified
method.
Sourceยงfn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default.
Sourceยงimpl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Sourceยงfn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Cast a collection of colors into a collection of arrays.
Sourceยงimpl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Sourceยงfn arrays_into(self) -> C
fn arrays_into(self) -> C
Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Sourceยงtype Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
The number type thatโs used in
parameters when converting.Sourceยงfn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self into C, using the provided parameters.Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Sourceยงfn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Cast a collection of colors into a collection of color components.
ยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
ยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.ยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.ยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Anyโs vtable from &Traitโs.ยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Anyโs vtable from &mut Traitโs.ยงimpl<T> DowncastSend for T
impl<T> DowncastSend for T
ยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Sourceยงimpl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Sourceยงfn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
Performs a conversion from
angle.Sourceยงimpl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Sourceยงfn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
Converts
other into Self, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงimpl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Sourceยงfn into_angle(self) -> U
fn into_angle(self) -> U
Performs a conversion into
T.Sourceยงimpl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Sourceยงtype Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
The number type thatโs used in
parameters when converting.Sourceยงfn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self into C, using the provided parameters.Sourceยงimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Sourceยงfn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Sourceยงimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Sourceยงfn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
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 moreยงimpl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for Iwhere
I: Into<T>,
impl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for Iwhere
I: Into<T>,
ยงfn into_reactive_value(self) -> T
fn into_reactive_value(self) -> T
Converts
self into a T.Sourceยงimpl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Sourceยงfn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
self into T, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Pointable for T
impl<T> Pointable for T
ยงimpl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
ยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
ยงimpl<T> SetValue for Twhere
T: WriteValue,
impl<T> SetValue for Twhere
T: WriteValue,
ยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
ยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
ยงfn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.
Sourceยงimpl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Sourceยงtype Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
The error for when
try_into_colors fails to cast.Sourceยงfn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Try to cast this collection of color components into a collection of
colors. Read more
Sourceยงimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Sourceยงfn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds error is returned which contains
the unclamped color. Read moreSourceยงimpl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
Sourceยงfn uints_from(colors: C) -> U
fn uints_from(colors: C) -> U
Cast a collection of colors into a collection of unsigned integers.
Sourceยงimpl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
Sourceยงfn uints_into(self) -> C
fn uints_into(self) -> C
Cast this collection of unsigned integers into a collection of colors.
ยงimpl<T> UpdateValue for Twhere
T: WriteValue,
impl<T> UpdateValue for Twhere
T: WriteValue,
ยงtype Value = <T as WriteValue>::Value
type Value = <T as WriteValue>::Value
The type of the value contained in the value.
ยงfn try_update_value<U>(
&self,
fun: impl FnOnce(&mut <T as UpdateValue>::Value) -> U,
) -> Option<U>
fn try_update_value<U>( &self, fun: impl FnOnce(&mut <T as UpdateValue>::Value) -> U, ) -> Option<U>
Updates the value, returning the value that is
returned by the update function, or
None if the value has already been disposed.ยงfn update_value(&self, fun: impl FnOnce(&mut Self::Value))
fn update_value(&self, fun: impl FnOnce(&mut Self::Value))
Updates the value.
ยงimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
ยงfn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โwhere
S: Into<Dispatch>,
ยงfn with_current_subscriber(self) -> WithDispatch<Self> โ
fn with_current_subscriber(self) -> WithDispatch<Self> โ
ยงimpl<T> WithValue for T
impl<T> WithValue for T
ยงtype Value = <<T as ReadValue>::Value as Deref>::Target
type Value = <<T as ReadValue>::Value as Deref>::Target
The type of the value contained in the value.
ยงfn try_with_value<U>(
&self,
fun: impl FnOnce(&<T as WithValue>::Value) -> U,
) -> Option<U>
fn try_with_value<U>( &self, fun: impl FnOnce(&<T as WithValue>::Value) -> U, ) -> Option<U>
Applies the closure to the value, non-reactively, and returns the result,
or
None if the value has already been disposed.ยงfn with_value<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U
fn with_value<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U
Applies the closure to the value, non-reactively, and returns the result. Read more