pub struct ReadOnlyVar<T, V>(/* private fields */);
Expand description
See Var::read_only
.
Implementations§
source§impl<T> ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
impl<T> ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
sourcepub fn with_rsp<R>(&self, read: impl FnOnce(&T) -> R) -> Option<R>
pub fn with_rsp<R>(&self, read: impl FnOnce(&T) -> R) -> Option<R>
Visit the response, if present.
sourcepub fn with_new_rsp<R>(&self, read: impl FnOnce(&T) -> R) -> Option<R>
pub fn with_new_rsp<R>(&self, read: impl FnOnce(&T) -> R) -> Option<R>
Visit the response, if present and new.
sourcepub fn is_waiting(&self) -> bool
pub fn is_waiting(&self) -> bool
If the response is not received yet.
sourcepub async fn wait_rsp(&self) -> T
pub async fn wait_rsp(&self) -> T
Returns a future that awaits until a response is received and then returns a clone.
sourcepub async fn wait_into_rsp(self) -> T
pub async fn wait_into_rsp(self) -> T
Returns a future that awaits until a response is received and then returns it.
Will clone the value if the variable is shared.
Note that ResponseVar<T>
implements IntoFuture
so you can also just .await
the variable.
sourcepub fn into_rsp(self) -> Option<T>
pub fn into_rsp(self) -> Option<T>
Into response, if received.
Clones if the variable is has more than one strong reference.
sourcepub fn map_rsp<O, I, M>(&self, waiting_value: I, map: M) -> impl Var<O>
pub fn map_rsp<O, I, M>(&self, waiting_value: I, map: M) -> impl Var<O>
Map the response value using map
, if the variable is awaiting a response uses the waiting_value
first.
sourcepub fn map_response<O, M>(
&self,
map: M,
) -> ReadOnlyVar<Response<O>, ArcVar<Response<O>>>
pub fn map_response<O, M>( &self, map: M, ) -> ReadOnlyVar<Response<O>, ArcVar<Response<O>>>
Map to another response variable.
Trait Implementations§
source§impl<T, V> AnyVar for ReadOnlyVar<T, V>
impl<T, V> AnyVar for ReadOnlyVar<T, V>
source§fn as_unboxed_any(&self) -> &(dyn Any + 'static)
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<ReadOnlyVar<T, V>>) -> Box<dyn Any>
fn double_boxed_any(self: Box<ReadOnlyVar<T, V>>) -> Box<dyn Any>
source§fn var_type_id(&self) -> TypeId
fn var_type_id(&self) -> TypeId
source§fn get_any(&self) -> Box<dyn AnyVarValue>
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)))
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
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, _: Box<dyn AnyVarValue>) -> Result<(), VarIsReadOnlyError>
fn set_any(&self, _: 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 moresource§fn last_update(&self) -> VarUpdateId
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
fn is_contextual(&self) -> bool
If the variable represents different values depending on the context where they are read.
source§fn capabilities(&self) -> VarCapability
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
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 moresource§fn hook_animation_stop(
&self,
handler: Box<dyn FnOnce() + Send>,
) -> Result<(), Box<dyn FnOnce() + Send>>
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 moresource§fn strong_count(&self) -> usize
fn strong_count(&self) -> usize
Gets the number of strong references to the variable. Read more
source§fn weak_count(&self) -> usize
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>
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>
fn downgrade_any(&self) -> Box<dyn AnyWeakVar>
Create a weak reference to this Arc variable. Read more
source§fn is_animating(&self) -> bool
fn is_animating(&self) -> bool
If the variable current value was set by an active animation. Read more
source§fn modify_importance(&self) -> usize
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<'_>
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 update(&self) -> Result<(), VarIsReadOnlyError>
fn update(&self) -> Result<(), VarIsReadOnlyError>
Schedule a variable update, even if the value does no change. Read more
source§impl<T, V> Clone for ReadOnlyVar<T, V>
impl<T, V> Clone for ReadOnlyVar<T, V>
source§fn clone(&self) -> ReadOnlyVar<T, V>
fn clone(&self) -> ReadOnlyVar<T, V>
Returns a copy 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 moresource§impl From<ReadOnlyVar<Img, ArcVar<Img>>> for ImageSource
impl From<ReadOnlyVar<Img, ArcVar<Img>>> for ImageSource
source§fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> ImageSource
fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> ImageSource
Converts to this type from the input type.
source§impl From<ReadOnlyVar<Img, ArcVar<Img>>> for WindowIcon
impl From<ReadOnlyVar<Img, ArcVar<Img>>> for WindowIcon
source§fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> WindowIcon
fn from(image: ReadOnlyVar<Img, ArcVar<Img>>) -> WindowIcon
Converts to this type from the input type.
source§impl<T> IntoFuture for ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
impl<T> IntoFuture for ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
source§type IntoFuture = Pin<Box<dyn Future<Output = T> + Sync + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = T> + Sync + Send>>
Which kind of future are we turning this into?
source§fn into_future(
self,
) -> <ReadOnlyVar<Response<T>, ArcVar<Response<T>>> as IntoFuture>::IntoFuture
fn into_future( self, ) -> <ReadOnlyVar<Response<T>, ArcVar<Response<T>>> as IntoFuture>::IntoFuture
Creates a future from a value. Read more
source§impl IntoVar<ImageSource> for ReadOnlyVar<Img, ArcVar<Img>>
impl IntoVar<ImageSource> for ReadOnlyVar<Img, ArcVar<Img>>
source§fn into_var(
self,
) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<ImageSource>>::Var
fn into_var( self, ) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<ImageSource>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl<T, V> IntoVar<T> for ReadOnlyVar<T, V>
impl<T, V> IntoVar<T> for ReadOnlyVar<T, V>
source§type Var = ReadOnlyVar<T, V>
type Var = ReadOnlyVar<T, V>
Variable type that will wrap the
T
value. Read moresource§fn into_var(self) -> <ReadOnlyVar<T, V> as IntoVar<T>>::Var
fn into_var(self) -> <ReadOnlyVar<T, V> as IntoVar<T>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<WindowIcon> for ReadOnlyVar<Img, ArcVar<Img>>
impl IntoVar<WindowIcon> for ReadOnlyVar<Img, ArcVar<Img>>
source§fn into_var(self) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<WindowIcon>>::Var
fn into_var(self) -> <ReadOnlyVar<Img, ArcVar<Img>> as IntoVar<WindowIcon>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl<T> ResponseVarSubscribe<T> for ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
impl<T> ResponseVarSubscribe<T> for ReadOnlyVar<Response<T>, ArcVar<Response<T>>>where
T: VarValue,
source§fn on_pre_rsp<H>(&self, handler: H) -> VarHandlewhere
H: AppHandler<OnVarArgs<T>>,
fn on_pre_rsp<H>(&self, handler: H) -> VarHandlewhere
H: AppHandler<OnVarArgs<T>>,
Add a
handler
that is called once when the response is received,
the handler is called before all other UI updates. Read moresource§impl<T, V> Var<T> for ReadOnlyVar<T, V>
impl<T, V> Var<T> for ReadOnlyVar<T, V>
source§type ReadOnly = ReadOnlyVar<T, V>
type ReadOnly = ReadOnlyVar<T, V>
Output of
Var::read_only
.source§type Downgrade = WeakReadOnlyVar<T, <V as Var<T>>::Downgrade>
type Downgrade = WeakReadOnlyVar<T, <V as Var<T>>::Downgrade>
Output of
Var::downgrade
.source§type FlatMap<O: VarValue, VF: Var<O>> = <V as Var<T>>::FlatMap<O, VF>
type FlatMap<O: VarValue, VF: Var<O>> = <V as Var<T>>::FlatMap<O, VF>
Output of
Var::flat_map
.source§type FilterMapBidi<O: VarValue> = <V as Var<T>>::FilterMap<O>
type FilterMapBidi<O: VarValue> = <V as Var<T>>::FilterMap<O>
Output of
Var::filter_map_bidi
.source§type MapRefBidi<O: VarValue> = <V as Var<T>>::MapRef<O>
type MapRefBidi<O: VarValue> = <V as Var<T>>::MapRef<O>
Output of
Var::map_ref_bidi
.source§fn modify<F>(&self, _: F) -> Result<(), VarIsReadOnlyError>
fn modify<F>(&self, _: F) -> Result<(), VarIsReadOnlyError>
Schedule a variable update, it will be applied on the end of the current app update.
source§fn boxed(self) -> Box<dyn VarBoxed<T>>where
ReadOnlyVar<T, V>: Sized,
fn boxed(self) -> Box<dyn VarBoxed<T>>where
ReadOnlyVar<T, V>: Sized,
Gets the variable as a
BoxedVar<T>
, does not double box.source§fn actual_var(self) -> <ReadOnlyVar<T, V> as Var<T>>::ActualVar
fn actual_var(self) -> <ReadOnlyVar<T, V> 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) -> <ReadOnlyVar<T, V> as Var<T>>::Downgrade
fn downgrade(&self) -> <ReadOnlyVar<T, V> as Var<T>>::Downgrade
Create a weak reference to this Arc variable.
source§fn into_value(self) -> T
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) -> <ReadOnlyVar<T, V> as Var<T>>::ReadOnly
fn read_only(&self) -> <ReadOnlyVar<T, V> 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) -> <ReadOnlyVar<T, V> as Var<T>>::Map<O>
fn map<O, M>(&self, map: M) -> <ReadOnlyVar<T, V> as Var<T>>::Map<O>
Creates a var that maps from this variable. Read more
source§fn map_bidi<O, M, B>(
&self,
map: M,
_: B,
) -> <ReadOnlyVar<T, V> as Var<T>>::MapBidi<O>
fn map_bidi<O, M, B>( &self, map: M, _: B, ) -> <ReadOnlyVar<T, V> as Var<T>>::MapBidi<O>
Create a var that maps from this variable on read and to it on write. Read more
source§fn flat_map<O, VF, M>(
&self,
map: M,
) -> <ReadOnlyVar<T, V> as Var<T>>::FlatMap<O, VF>
fn flat_map<O, VF, M>( &self, map: M, ) -> <ReadOnlyVar<T, V> as Var<T>>::FlatMap<O, VF>
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,
) -> <ReadOnlyVar<T, V> as Var<T>>::FilterMap<O>
fn filter_map<O, M, I>( &self, map: M, fallback: I, ) -> <ReadOnlyVar<T, V> as Var<T>>::FilterMap<O>
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,
_: B,
fallback: I,
) -> <ReadOnlyVar<T, V> as Var<T>>::FilterMapBidi<O>
fn filter_map_bidi<O, M, B, I>( &self, map: M, _: B, fallback: I, ) -> <ReadOnlyVar<T, V> as Var<T>>::FilterMapBidi<O>
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) -> <ReadOnlyVar<T, V> as Var<T>>::MapRef<O>
fn map_ref<O, M>(&self, map: M) -> <ReadOnlyVar<T, V> as Var<T>>::MapRef<O>
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,
_: B,
) -> <ReadOnlyVar<T, V> as Var<T>>::MapRefBidi<O>
fn map_ref_bidi<O, M, B>( &self, map: M, _: B, ) -> <ReadOnlyVar<T, V> as Var<T>>::MapRefBidi<O>
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,
) -> <ReadOnlyVar<T, V> as Var<T>>::Easing
fn easing<F>( &self, duration: Duration, easing: F, ) -> <ReadOnlyVar<T, V> as Var<T>>::Easing
source§fn easing_with<F, S>(
&self,
duration: Duration,
easing: F,
sampler: S,
) -> <ReadOnlyVar<T, V> as Var<T>>::Easingwhere
T: Transitionable,
F: Fn(EasingTime) -> Factor + Send + Sync + 'static,
S: Fn(&Transition<T>, Factor) -> T + Send + Sync + 'static,
fn easing_with<F, S>(
&self,
duration: Duration,
easing: F,
sampler: S,
) -> <ReadOnlyVar<T, V> as Var<T>>::Easingwhere
T: Transitionable,
F: Fn(EasingTime) -> Factor + Send + Sync + 'static,
S: Fn(&Transition<T>, Factor) -> T + Send + Sync + 'static,
source§fn boxed_any(self) -> Box<dyn AnyVar>where
Self: Sized,
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
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 moresource§fn wait_update(&self) -> impl Future<Output = VarUpdateId> + Send + Sync
fn wait_update(&self) -> impl Future<Output = VarUpdateId> + Send + Sync
Awaits for the
last_update
to change. Read moresource§fn wait_value(
&self,
predicate: impl Fn(&T) -> bool + Send + Sync,
) -> impl Future<Output = ()> + Send + Sync
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>
fn with_new<R, F>(&self, read: F) -> Option<R>
Visit the current value of the variable, if it
is_new
.source§fn get_ne(&self, value: &mut T) -> bool
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_into(&self, value: &mut T) -> bool
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
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>,
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>,
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 moresource§fn set_from_map<Iv, I, M>(
&self,
other: &I,
map: M,
) -> Result<(), VarIsReadOnlyError>
fn set_from_map<Iv, I, M>( &self, other: &I, map: M, ) -> Result<(), VarIsReadOnlyError>
Set from
other
value at the time of update, mapped to the type of self
.source§fn filter_try_into<O, I>(&self, fallback: I) -> Self::FilterMap<O>
fn filter_try_into<O, I>(&self, fallback: I) -> Self::FilterMap<O>
source§fn bind_filter_map<T2, V2, F>(&self, other: &V2, map: F) -> VarHandle
fn bind_filter_map<T2, V2, F>(&self, other: &V2, map: F) -> VarHandle
Setup a hook that assigns
other
with the new values of self
transformed by map
, if the closure returns a value. Read moresource§fn bind_map_bidi<T2, V2, M, B>(
&self,
other: &V2,
map: M,
map_back: B,
) -> VarHandles
fn bind_map_bidi<T2, V2, M, B>( &self, other: &V2, map: M, map_back: B, ) -> VarHandles
source§fn bind_filter_map_bidi<T2, V2, M, B>(
&self,
other: &V2,
map: M,
map_back: B,
) -> VarHandles
fn bind_filter_map_bidi<T2, V2, M, B>( &self, other: &V2, map: M, map_back: B, ) -> VarHandles
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 moresource§fn set_bind<V2>(&self, other: &V2) -> VarHandlewhere
V2: Var<T>,
fn set_bind<V2>(&self, other: &V2) -> VarHandlewhere
V2: Var<T>,
Calls
other.set_from(self)
and self.bind(other)
.source§fn bind_bidi<V2>(&self, other: &V2) -> VarHandleswhere
V2: Var<T>,
fn bind_bidi<V2>(&self, other: &V2) -> VarHandleswhere
V2: Var<T>,
Setup two hooks that assigns
other
with the new values of self
and self
with the new values of other
. Read moresource§fn trace_value<E, S>(&self, enter_value: E) -> VarHandle
fn trace_value<E, S>(&self, enter_value: E) -> VarHandle
Debug helper for tracing the lifetime of a value in this variable. Read more
source§fn animate<A>(&self, animate: A) -> AnimationHandle
fn animate<A>(&self, animate: A) -> AnimationHandle
Schedule an animation that targets this variable. Read more
source§fn sequence<A>(&self, animate: A) -> VarHandle
fn sequence<A>(&self, animate: A) -> VarHandle
Schedule animations started by
animate
, the closure is called once at the start to begin, then again every time
the variable stops animating. Read moresource§fn step_oci<N>(&self, new_value: N, delay: Duration) -> AnimationHandlewhere
N: Into<T>,
fn step_oci<N>(&self, new_value: N, delay: Duration) -> AnimationHandlewhere
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
fn set_step_oci<V0, V1>( &self, from: V0, to: V1, delay: Duration, ) -> AnimationHandle
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
fn steps<F>( &self, steps: Vec<(Factor, T)>, duration: Duration, easing: F, ) -> AnimationHandle
Set the variable to a sequence of values as a time
duration
elapses. Read moresource§fn debug(&self) -> VarDebug<'_, T, Self>
fn debug(&self) -> VarDebug<'_, T, Self>
Returns a wrapper that implements
fmt::Debug
to write the var value.impl IntoValue<ImageSource> for ReadOnlyVar<Img, ArcVar<Img>>
impl IntoValue<WindowIcon> for ReadOnlyVar<Img, ArcVar<Img>>
Auto Trait Implementations§
impl<T, V> Freeze for ReadOnlyVar<T, V>where
V: Freeze,
impl<T, V> RefUnwindSafe for ReadOnlyVar<T, V>where
V: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, V> Send for ReadOnlyVar<T, V>
impl<T, V> Sync for ReadOnlyVar<T, V>
impl<T, V> Unpin for ReadOnlyVar<T, V>
impl<T, V> UnwindSafe for ReadOnlyVar<T, V>where
V: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<V> AnyVarSubscribe for Vwhere
V: AnyVar,
impl<V> AnyVarSubscribe for Vwhere
V: AnyVar,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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>
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>
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)
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)
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
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> 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 moresource§impl<V> LightDarkVarExt for V
impl<V> LightDarkVarExt for V
source§fn rgba_map<T>(
&self,
map: impl FnMut(Rgba) -> T + Send + 'static,
) -> impl Var<T>where
T: VarValue,
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>
fn rgba_into<T>(&self) -> impl Var<T>
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>
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>
fn map_rgba_into<T>( &self, map: impl FnMut(LightDark) -> LightDark + Send + 'static, ) -> impl Var<T>
Gets a contextualized var that maps using
map
and then into T
.source§fn shade_fct(&self, fct: impl Into<Factor>) -> impl Var<Rgba>
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_fct_into<T>(&self, fct: impl Into<Factor>) -> impl Var<T>
fn shade_fct_into<T>(&self, fct: impl Into<Factor>) -> impl Var<T>
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>
fn shade_into<T>(&self, shade: i8) -> impl Var<T>
Gets a contextualized var that maps to
LightDark::shade
and then to LightDark::rgba
and then into T
.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, V> VarLayout<T> for V
impl<T, V> VarLayout<T> for V
source§fn layout(&self) -> <T as Layout2d>::Pxwhere
T: Layout2d,
fn layout(&self) -> <T as Layout2d>::Pxwhere
T: Layout2d,
Compute the pixel value in the current
LAYOUT
context.source§fn layout_dft(&self, default: <T as Layout2d>::Px) -> <T as Layout2d>::Pxwhere
T: Layout2d,
fn layout_dft(&self, default: <T as Layout2d>::Px) -> <T as Layout2d>::Pxwhere
T: Layout2d,
Compute the pixel value in the current
LAYOUT
context with default
.source§fn layout_x(&self) -> Pxwhere
T: Layout1d,
fn layout_x(&self) -> Pxwhere
T: Layout1d,
Compute the pixel value in the current
LAYOUT
context x axis.source§fn layout_y(&self) -> Pxwhere
T: Layout1d,
fn layout_y(&self) -> Pxwhere
T: Layout1d,
Compute the pixel value in the current
LAYOUT
context y axis.source§fn layout_z(&self) -> Pxwhere
T: Layout1d,
fn layout_z(&self) -> Pxwhere
T: Layout1d,
Compute the pixel value in the current
LAYOUT
context z axis.source§fn layout_dft_x(&self, default: Px) -> Pxwhere
T: Layout1d,
fn layout_dft_x(&self, default: Px) -> Pxwhere
T: Layout1d,
Compute the pixel value in the current
LAYOUT
context x axis with default
.source§impl<T, V> VarSubscribe<T> for V
impl<T, V> VarSubscribe<T> for V
source§fn subscribe_when(
&self,
op: UpdateOp,
widget_id: WidgetId,
predicate: impl Fn(&T) -> bool + Send + Sync + 'static,
) -> VarHandle
fn subscribe_when( &self, op: UpdateOp, widget_id: WidgetId, predicate: impl Fn(&T) -> bool + Send + Sync + 'static, ) -> VarHandle
source§fn on_pre_new<H>(&self, handler: H) -> VarHandlewhere
H: AppHandler<OnVarArgs<T>>,
fn on_pre_new<H>(&self, handler: H) -> VarHandlewhere
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