Struct zng::var::ContextualizedVar

source ·
pub struct ContextualizedVar<T> { /* private fields */ }
Expand description

Represents a variable that delays initialization until the first usage.

Usage that initializes the variable are all AnyVar and Var<T> methods except read_only, downgrade and boxed. The variable re-initializes when the ContextInitHandle::current is different on usage.

This variable is used in the Var::map and other mapping methods to support mapping from ContextVar<T>.

let wgt = MyWgt! {
    my_property = MY_CTX_VAR.map(|&b| !b);
};

In the example above the mapping var will bind with the MY_CTX_VAR context inside the property node, not the context at the moment the widget is instantiated.

§Clone

Note that a clone of this variable may call the init closure again for the same context, the inited actual var is only reused if it is already inited when clone is called and clone is called on the same context.

Implementations§

source§

impl<T> ContextualizedVar<T>
where T: VarValue,

source

pub fn new<V>( init: impl Fn() -> V + Send + Sync + 'static, ) -> ContextualizedVar<T>
where V: Var<T>,

New with initialization function.

The init closure will be called on the first usage of the var, once after the var is cloned and any time a parent contextualized var is initializing.

source

pub fn new_value( init: impl Fn() -> T + Send + Sync + 'static, ) -> ContextualizedVar<T>

New with initialization function that produces a value.

The init closure will be called on the first usage of the var, once after the var is cloned and any time a parent contextualized var is initializing.

source

pub fn borrow_init( &self, ) -> MappedRwLockReadGuard<'_, RawRwLock, Box<dyn VarBoxed<T>>>

Borrow/initialize the actual var.

source

pub fn into_init(self) -> Box<dyn VarBoxed<T>>

Unwraps the initialized actual var or initializes it now.

Trait Implementations§

source§

impl<T> AnyVar for ContextualizedVar<T>
where T: VarValue,

source§

fn clone_any(&self) -> Box<dyn AnyVar>

Clone the variable into a type erased box. Read more
source§

fn as_any(&self) -> &(dyn Any + 'static)

Access to dyn Any methods.
source§

fn as_unboxed_any(&self) -> &(dyn Any + 'static)

Access to dyn Any methods, on the underlying variable type if boxed.
source§

fn double_boxed_any(self: Box<ContextualizedVar<T>>) -> Box<dyn Any>

Access to Box<dyn Any> methods, with the BoxedVar<T> type. Read more
source§

fn var_type_id(&self) -> TypeId

Gets the TypeId of T in Var<T>.
source§

fn get_any(&self) -> Box<dyn AnyVarValue>

Get a clone of the current value, with type erased.
source§

fn with_any(&self, read: &mut dyn FnMut(&(dyn AnyVarValue + 'static)))

Visit the current value of the variable.
source§

fn with_new_any( &self, read: &mut dyn FnMut(&(dyn AnyVarValue + 'static)), ) -> bool

Visit the current value of the variable, if it is_new.
source§

fn set_any(&self, value: Box<dyn AnyVarValue>) -> Result<(), VarIsReadOnlyError>

Schedule a new value for the variable, it will be set in the end of the current app update. Read more
source§

fn last_update(&self) -> VarUpdateId

Last update ID a variable was modified, if the ID is equal to VARS.update_id the variable is new.
source§

fn is_contextual(&self) -> bool

If the variable represents different values depending on the context where they are read.
source§

fn capabilities(&self) -> VarCapability

Flags that indicate what operations the variable is capable of in this update.
source§

fn hook_any( &self, pos_modify_action: Box<dyn Fn(&AnyVarHookArgs<'_>) -> bool + Sync + Send>, ) -> VarHandle

Setups a callback for just after the variable value update is applied, the closure runs in the root app context, just like the modify closure. The closure can return if it is retained after each call. If you modify another variable in a hook the modification applies in the same update, variable mapping and binding is implemented using hooks. Read more
source§

fn hook_animation_stop( &self, handler: Box<dyn FnOnce() + Send>, ) -> Result<(), Box<dyn FnOnce() + Send>>

Register a handler to be called when the current animation stops. Read more
source§

fn strong_count(&self) -> usize

Gets the number of strong references to the variable. Read more
source§

fn weak_count(&self) -> usize

Gets the number of weak references to the variable. Read more
source§

fn actual_var_any(&self) -> Box<dyn AnyVar>

Gets a clone of the represented var from ContextVar<T>, gets a clone of self for other var types.
source§

fn downgrade_any(&self) -> Box<dyn AnyWeakVar>

Create a weak reference to this Arc variable. Read more
source§

fn is_animating(&self) -> bool

If the variable current value was set by an active animation. Read more
source§

fn modify_importance(&self) -> usize

Gets a value that indicates the importance clearance that is needed to modify this variable. Read more
source§

fn var_ptr(&self) -> VarPtr<'_>

Var pointer, that can be used to identify if two variables point to the same rc or context. Read more
source§

fn get_debug(&self) -> Txt

Get the value as a debug Txt.
source§

fn update(&self) -> Result<(), VarIsReadOnlyError>

Schedule a variable update, even if the value does no change. Read more
source§

fn map_debug(&self) -> Box<dyn VarBoxed<Txt>>

Create a map that converts from T to a Txt debug print.
source§

fn is_new(&self) -> bool

Gets if the last_update is the current update, meaning the variable value just changed. Read more
source§

fn perm(&self)

Hold the variable in memory until the app exit.
source§

fn hold_any(&self, value: Box<dyn Any + Sync + Send>) -> VarHandle

Keep other alive until the handle or self are dropped.
source§

impl<T> Clone for ContextualizedVar<T>
where T: VarValue,

source§

fn clone(&self) -> ContextualizedVar<T>

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

impl<T> IntoVar<T> for ContextualizedVar<T>
where T: VarValue,

source§

type Var = ContextualizedVar<T>

Variable type that will wrap the T value. Read more
source§

fn into_var(self) -> <ContextualizedVar<T> as IntoVar<T>>::Var

Converts the source value into a var.
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl<T> Var<T> for ContextualizedVar<T>
where T: VarValue,

source§

type ReadOnly = ReadOnlyVar<T, ContextualizedVar<T>>

Output of Var::read_only.
source§

type ActualVar = Box<dyn VarBoxed<T>>

Output of Var::actual_var.
source§

type Downgrade = WeakContextualizedVar<T>

Output of Var::downgrade.
source§

type Map<O: VarValue> = ContextualizedVar<O>

Output of Var::map.
source§

type MapBidi<O: VarValue> = ContextualizedVar<O>

Output of Var::map_bidi.
source§

type FlatMap<O: VarValue, V: Var<O>> = ContextualizedVar<O>

Output of Var::flat_map.
source§

type FilterMap<O: VarValue> = ContextualizedVar<O>

Output of Var::filter_map.
source§

type FilterMapBidi<O: VarValue> = ContextualizedVar<O>

source§

type MapRef<O: VarValue> = MapRef<T, O, ContextualizedVar<T>>

Output of Var::map_ref.
source§

type MapRefBidi<O: VarValue> = MapRefBidi<T, O, ContextualizedVar<T>>

source§

type Easing = ContextualizedVar<T>

Output of Var::easing.
source§

fn with<R, F>(&self, read: F) -> R
where F: FnOnce(&T) -> R,

Visit the current value of the variable.
source§

fn modify<F>(&self, modify: F) -> Result<(), VarIsReadOnlyError>
where F: FnOnce(&mut VarModify<'_, T>) + Send + 'static,

Schedule a variable update, it will be applied on the end of the current app update.
source§

fn actual_var(self) -> <ContextualizedVar<T> as Var<T>>::ActualVar

Gets the current inner var represented by this var. This can be the same var or a context var.
source§

fn downgrade(&self) -> <ContextualizedVar<T> as Var<T>>::Downgrade

Create a weak reference to this Arc variable.
source§

fn into_value(self) -> T

Convert this variable to the value, if possible moves the value, if it is shared clones it.
source§

fn read_only(&self) -> <ContextualizedVar<T> as Var<T>>::ReadOnly

Gets a clone of the var that is always read-only. Read more
source§

fn map<O, M>(&self, map: M) -> <ContextualizedVar<T> as Var<T>>::Map<O>
where O: VarValue, M: FnMut(&T) -> O + Send + 'static,

Creates a var that maps from this variable. Read more
source§

fn map_bidi<O, M, B>( &self, map: M, map_back: B, ) -> <ContextualizedVar<T> as Var<T>>::MapBidi<O>
where O: VarValue, M: FnMut(&T) -> O + Send + 'static, B: FnMut(&O) -> T + Send + 'static,

Create a var that maps from this variable on read and to it on write. Read more
source§

fn flat_map<O, V, M>( &self, map: M, ) -> <ContextualizedVar<T> as Var<T>>::FlatMap<O, V>
where O: VarValue, V: Var<O>, M: FnMut(&T) -> V + Send + 'static,

Create a var that maps to an inner variable that is found inside the value of this variable. Read more
source§

fn filter_map<O, M, I>( &self, map: M, fallback: I, ) -> <ContextualizedVar<T> as Var<T>>::FilterMap<O>
where O: VarValue, M: FnMut(&T) -> Option<O> + Send + 'static, I: Fn() -> O + Send + Sync + 'static,

Creates a ref-counted var that maps from this variable, but can retain a previous mapped value. Read more
source§

fn filter_map_bidi<O, M, B, I>( &self, map: M, map_back: B, fallback: I, ) -> <ContextualizedVar<T> as Var<T>>::FilterMapBidi<O>
where O: VarValue, M: FnMut(&T) -> Option<O> + Send + 'static, B: FnMut(&O) -> Option<T> + Send + 'static, I: Fn() -> O + Send + Sync + 'static,

Create a var that maps from this variable on read and to it on write, mapping in both directions can skip updates, retaining the previous mapped value. Read more
source§

fn map_ref<O, M>(&self, map: M) -> <ContextualizedVar<T> as Var<T>>::MapRef<O>
where O: VarValue, M: Fn(&T) -> &O + Send + Sync + 'static,

Create a mapping wrapper around self. The map closure is called for each value access, it must reference the value O that already exists in T.
source§

fn map_ref_bidi<O, M, B>( &self, map: M, map_mut: B, ) -> <ContextualizedVar<T> as Var<T>>::MapRefBidi<O>
where O: VarValue, M: Fn(&T) -> &O + Send + Sync + 'static, B: Fn(&mut T) -> &mut O + Send + Sync + 'static,

Create a mapping wrapper around self. The map closure is called for each value access, it must reference the value O that already exists in T, the map_mut closure is called for every modify request, it must do the same as map but with mutable access.
source§

fn easing<F>( &self, duration: Duration, easing: F, ) -> <ContextualizedVar<T> as Var<T>>::Easing
where T: Transitionable, F: Fn(EasingTime) -> Factor + Send + Sync + 'static,

Create a vars that ease to each new value of self. Read more
source§

fn easing_with<F, SE>( &self, duration: Duration, easing: F, sampler: SE, ) -> <ContextualizedVar<T> as Var<T>>::Easing
where T: Transitionable, F: Fn(EasingTime) -> Factor + Send + Sync + 'static, SE: Fn(&Transition<T>, Factor) -> T + Send + Sync + 'static,

Create a vars that ease_with to each new value of self. Read more
source§

fn boxed(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Gets the variable as a BoxedVar<T>, does not double box.
source§

fn boxed_any(self) -> Box<dyn AnyVar>
where Self: Sized,

Gets the variable as a BoxedAnyVar, does not double box.
source§

fn hook( &self, pos_modify_action: impl Fn(&VarHookArgs<'_, T>) -> bool + Send + Sync + 'static, ) -> VarHandle

Setups a callback for just after the variable value update is applied, the closure runs in the root app context, just like the modify closure. The closure can return if it is retained after each call. If you modify another variable in a hook the modification applies in the same update, variable mapping and binding is implemented using hooks. Read more
source§

fn wait_update(&self) -> impl Future<Output = VarUpdateId> + Send + Sync

Awaits for the last_update to change. Read more
source§

fn wait_animation(&self) -> impl Future<Output = ()> + Send + Sync

Awaits for is_animating to change from true to false. Read more
source§

fn wait_value( &self, predicate: impl Fn(&T) -> bool + Send + Sync, ) -> impl Future<Output = ()> + Send + Sync

Awaits for a value that passes the predicate.
source§

fn with_new<R, F>(&self, read: F) -> Option<R>
where F: FnOnce(&T) -> R,

Visit the current value of the variable, if it is_new.
source§

fn get(&self) -> T

Get a clone of the current value.
source§

fn get_into(&self, value: &mut T)

Get a clone of the current value into value.
source§

fn get_ne(&self, value: &mut T) -> bool

Get a clone of the current value into value if the current value is not equal to it.
source§

fn get_new(&self) -> Option<T>

Get a clone of the current value, if it is_new.
source§

fn get_new_into(&self, value: &mut T) -> bool

Get a clone of the current value into value if the current value is_new.
source§

fn get_new_ne(&self, value: &mut T) -> bool

Get a clone of the current value into value if the variable value is_new and not equal to the value.
source§

fn set<I>(&self, value: I) -> Result<(), VarIsReadOnlyError>
where I: Into<T>,

Schedule a new value for the variable, it will be set in the end of the current app update.
source§

fn set_from<I>(&self, other: &I) -> Result<(), VarIsReadOnlyError>
where I: Var<T>,

Schedule a new value for the variable, it will be set in the end of the current app update to the updated value of other, so if the other var has already scheduled an update, the updated value will be used. Read more
source§

fn set_from_map<Iv, I, M>( &self, other: &I, map: M, ) -> Result<(), VarIsReadOnlyError>
where Iv: VarValue, I: Var<Iv>, M: FnOnce(&Iv) -> T + Send + 'static,

Set from other value at the time of update, mapped to the type of self.
source§

fn cow(&self) -> ArcCowVar<T, Self>

Create a var that redirects to this variable until the first value update, then it behaves like a ArcVar<T>. Read more
source§

fn map_into<O>(&self) -> Self::Map<O>
where O: VarValue, T: Into<O>,

Creates a map that converts from T to O using Into<O>.
source§

fn filter_try_into<O, I>(&self, fallback: I) -> Self::FilterMap<O>
where O: VarValue, T: TryInto<O>, I: Fn() -> O + Send + Sync + 'static,

Create a filter_map that tries to convert from T to O using TryInto<O>.
source§

fn bind_map<T2, V2, M>(&self, other: &V2, map: M) -> VarHandle
where T2: VarValue, V2: Var<T2>, M: FnMut(&T) -> T2 + Send + 'static,

Setup a hook that assigns other with the new values of self transformed by map. Read more
source§

fn bind_filter_map<T2, V2, F>(&self, other: &V2, map: F) -> VarHandle
where T2: VarValue, V2: Var<T2>, F: FnMut(&T) -> Option<T2> + Send + 'static,

Setup a hook that assigns other with the new values of self transformed by map, if the closure returns a value. Read more
source§

fn bind_map_bidi<T2, V2, M, B>( &self, other: &V2, map: M, map_back: B, ) -> VarHandles
where T2: VarValue, V2: Var<T2>, M: FnMut(&T) -> T2 + Send + 'static, B: FnMut(&T2) -> T + Send + 'static,

Bind self to other and back without causing an infinite loop. Read more
source§

fn bind_filter_map_bidi<T2, V2, M, B>( &self, other: &V2, map: M, map_back: B, ) -> VarHandles
where T2: VarValue, V2: Var<T2>, M: FnMut(&T) -> Option<T2> + Send + 'static, B: FnMut(&T2) -> Option<T> + Send + 'static,

Bind self to other and back with the new values of self transformed by map and the new values of other transformed by map_back, the value is assigned in a update only if the closures returns a value. Read more
source§

fn bind<V2>(&self, other: &V2) -> VarHandle
where V2: Var<T>,

Setup a hook that assigns other with the new values of self. Read more
source§

fn set_bind<V2>(&self, other: &V2) -> VarHandle
where V2: Var<T>,

Calls other.set_from(self) and self.bind(other).
source§

fn bind_bidi<V2>(&self, other: &V2) -> VarHandles
where V2: Var<T>,

Setup two hooks that assigns other with the new values of self and self with the new values of other. Read more
source§

fn trace_value<E, S>(&self, enter_value: E) -> VarHandle
where E: FnMut(&TraceValueArgs<'_, T>) -> S + Send + 'static, S: Send + 'static,

Debug helper for tracing the lifetime of a value in this variable. Read more
source§

fn animate<A>(&self, animate: A) -> AnimationHandle
where A: FnMut(&Animation, &mut VarModify<'_, T>) + Send + 'static,

Schedule an animation that targets this variable. Read more
source§

fn sequence<A>(&self, animate: A) -> VarHandle
where A: FnMut(&<<Self::ActualVar as Var<T>>::Downgrade as WeakVar<T>>::Upgrade) -> AnimationHandle + Send + 'static,

Schedule animations started by animate, the closure is called once at the start to begin, then again every time the variable stops animating. Read more
source§

fn step<N>(&self, new_value: N, delay: Duration) -> AnimationHandle
where N: Into<T>,

Set the variable to new_value after a delay. Read more
source§

fn step_oci<N>(&self, new_value: N, delay: Duration) -> AnimationHandle
where N: Into<T>,

Oscillate between the current value and new_value, every time the delay elapses the variable is set to the next value.
source§

fn set_step_oci<V0, V1>( &self, from: V0, to: V1, delay: Duration, ) -> AnimationHandle
where V0: Into<T>, V1: Into<T>,

Oscillate between from and to, the variable is set to from to start and every time the delay elapses the variable is set to the next value.
source§

fn steps<F>( &self, steps: Vec<(Factor, T)>, duration: Duration, easing: F, ) -> AnimationHandle
where F: Fn(EasingTime) -> Factor + Send + 'static,

Set the variable to a sequence of values as a time duration elapses. Read more
source§

fn debug(&self) -> VarDebug<'_, T, Self>

Returns a wrapper that implements fmt::Debug to write the var value.
source§

fn hold<V>(&self, value: V) -> VarHandle
where V: Any + Send,

Keep value alive until the handle or self are dropped.

Auto Trait Implementations§

§

impl<T> !Freeze for ContextualizedVar<T>

§

impl<T> !RefUnwindSafe for ContextualizedVar<T>

§

impl<T> Send for ContextualizedVar<T>
where T: Send,

§

impl<T> Sync for ContextualizedVar<T>
where T: Sync,

§

impl<T> Unpin for ContextualizedVar<T>
where T: Unpin,

§

impl<T> !UnwindSafe for ContextualizedVar<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<V> AnyVarSubscribe for V
where V: AnyVar,

source§

fn subscribe(&self, op: UpdateOp, widget_id: WidgetId) -> VarHandle

Register the widget to receive an UpdateOp when this variable is new. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast for T
where T: 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.
§

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

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

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

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<V> LightDarkVarExt for V
where V: Var<LightDark>,

source§

fn rgba(&self) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::rgba.
source§

fn rgba_map<T>( &self, map: impl FnMut(Rgba) -> T + Send + 'static, ) -> impl Var<T>
where T: VarValue,

Gets a contextualized var that maps to LightDark::rgba and map.
source§

fn rgba_into<T>(&self) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::rgba converted into T.
source§

fn map_rgba( &self, map: impl FnMut(LightDark) -> LightDark + Send + 'static, ) -> impl Var<Rgba>

Gets a contextualized var that maps using map and then to LightDark::rgba.
source§

fn map_rgba_into<T>( &self, map: impl FnMut(LightDark) -> LightDark + Send + 'static, ) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps using map and then into T.
source§

fn shade_fct(&self, fct: impl Into<Factor>) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::shade_fct and then to LightDark::rgba.
source§

fn shade(&self, shade: i8) -> impl Var<Rgba>

Gets a contextualized var that maps to LightDark::shade and then to LightDark::rgba. Read more
source§

fn shade_fct_into<T>(&self, fct: impl Into<Factor>) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::shade_fct and then to LightDark::rgba and then into T.
source§

fn shade_into<T>(&self, shade: i8) -> impl Var<T>
where T: VarValue + From<Rgba>,

Gets a contextualized var that maps to LightDark::shade and then to LightDark::rgba and then into T.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T, V> VarLayout<T> for V
where T: VarValue, V: Var<T>,

source§

fn layout(&self) -> <T as Layout2d>::Px
where T: Layout2d,

Compute the pixel value in the current LAYOUT context.
source§

fn layout_dft(&self, default: <T as Layout2d>::Px) -> <T as Layout2d>::Px
where T: Layout2d,

Compute the pixel value in the current LAYOUT context with default.
source§

fn layout_x(&self) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context x axis.
source§

fn layout_y(&self) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context y axis.
source§

fn layout_z(&self) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context z axis.
source§

fn layout_dft_x(&self, default: Px) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context x axis with default.
source§

fn layout_dft_y(&self, default: Px) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context y axis with default.
source§

fn layout_dft_z(&self, default: Px) -> Px
where T: Layout1d,

Compute the pixel value in the current LAYOUT context z axis with default.
source§

impl<T, V> VarSubscribe<T> for V
where T: VarValue, V: Var<T>,

source§

fn subscribe_when( &self, op: UpdateOp, widget_id: WidgetId, predicate: impl Fn(&T) -> bool + Send + Sync + 'static, ) -> VarHandle

Register the widget to receive an UpdateOp when this variable is new and the predicate approves the new value. Read more
source§

fn on_pre_new<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Add a preview handler that is called every time this variable updates, the handler is called before UI update. Read more
source§

fn on_new<H>(&self, handler: H) -> VarHandle
where H: AppHandler<OnVarArgs<T>>,

Add a handler that is called every time this variable updates, the handler is called after UI update. Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

source§

impl<T> StateValue for T
where T: Any + Send + Sync,