zng_app::render

Struct FrameValueKey

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

Unique key of an updatable value in the view-process frame.

Implementations§

source§

impl<T> FrameValueKey<T>

source

pub fn new_unique() -> Self

Generates a new unique ID.

source

pub fn to_wr(self) -> FrameValueId

To view key.

source

pub fn to_wr_child(self, child_index: u32) -> FrameValueId

To view key with an extra index modifier.

source

pub fn bind(self, value: T, animating: bool) -> FrameValue<T>

Create a binding with this key.

The animating flag controls if the binding will propagate to webrender, if true webrender frame updates are generated for

source

pub fn bind_child( self, child_index: u32, value: T, animating: bool, ) -> FrameValue<T>

Like bind but the key is modified to include the child_index.

source

pub fn update(self, value: T, animating: bool) -> FrameValueUpdate<T>

Create a value update with this key.

source

pub fn update_child( self, child_index: u32, value: T, animating: bool, ) -> FrameValueUpdate<T>

Like update but the key is modified to include the child_index.

source

pub fn bind_var<VT: VarValue>( self, var: &impl Var<VT>, map: impl FnOnce(&VT) -> T, ) -> FrameValue<T>

Create a binding with this key and var.

The map must produce a copy or clone of the frame value.

source

pub fn bind_var_child<VT: VarValue>( self, child_index: u32, var: &impl Var<VT>, map: impl FnOnce(&VT) -> T, ) -> FrameValue<T>

Like bind_var but the key is modified to include the child_index.

source

pub fn bind_var_mapped<VT: VarValue>( &self, var: &impl Var<VT>, value: T, ) -> FrameValue<T>

Create a binding with this key, var and already mapped value.

source

pub fn bind_var_mapped_child<VT: VarValue>( &self, child_index: u32, var: &impl Var<VT>, value: T, ) -> FrameValue<T>

Like bind_var_mapped but the key is modified to include the child_index.

source

pub fn update_var<VT: VarValue>( self, var: &impl Var<VT>, map: impl FnOnce(&VT) -> T, ) -> Option<FrameValueUpdate<T>>

Create a value update with this key and var.

source

pub fn update_var_child<VT: VarValue>( self, child_index: u32, var: &impl Var<VT>, map: impl FnOnce(&VT) -> T, ) -> Option<FrameValueUpdate<T>>

Like update_var but the key is modified to include the child_index.

source

pub fn update_var_mapped<VT: VarValue>( self, var: &impl Var<VT>, value: T, ) -> Option<FrameValueUpdate<T>>

Create a value update with this key, var and already mapped value.

source

pub fn update_var_mapped_child<VT: VarValue>( self, child_index: u32, var: &impl Var<VT>, value: T, ) -> Option<FrameValueUpdate<T>>

Like update_var_mapped but the key is modified to include the child_index.

Trait Implementations§

source§

impl<T> Clone for FrameValueKey<T>

source§

fn clone(&self) -> Self

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: Debug> Debug for FrameValueKey<T>

source§

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

Formats the value using the given formatter. Read more
source§

impl From<FrameValueKey<PxTransform>> for ReferenceFrameId

source§

fn from(value: FrameValueKey<PxTransform>) -> Self

Converts to this type from the input type.
source§

impl<T> PartialEq for FrameValueKey<T>

source§

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

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

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

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

impl<T> Copy for FrameValueKey<T>

source§

impl<T> Eq for FrameValueKey<T>

Auto Trait Implementations§

§

impl<T> Freeze for FrameValueKey<T>

§

impl<T> RefUnwindSafe for FrameValueKey<T>
where T: RefUnwindSafe,

§

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

§

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

§

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

§

impl<T> UnwindSafe for FrameValueKey<T>
where T: UnwindSafe,

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<T> AnyVarValue for T
where T: VarValue,

source§

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

Access to dyn Any methods.
source§

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

Access to mut dyn Any methods.
source§

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

Clone the value.
source§

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

Clone the value into a new boxed LocalVar<Self>.
source§

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

Access to Box<dyn Any> methods.
source§

fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool

Gets if self equals other.
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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, 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<T> IntoVar<T> for T
where T: VarValue,

source§

type Var = LocalVar<T>

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

fn into_var(self) -> <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
§

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> 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<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> IntoValue<T> for T
where T: VarValue,

source§

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

source§

impl<T> VarValue for T
where T: Debug + Clone + PartialEq + Any + Send + Sync,