Struct zng_var::VarHookArgs
source · pub struct VarHookArgs<'a, T: VarValue> { /* private fields */ }
Expand description
Arguments for Var::hook
.
Implementations§
Methods from Deref<Target = AnyVarHookArgs<'a>>§
sourcepub fn value(&self) -> &'a dyn AnyVarValue
pub fn value(&self) -> &'a dyn AnyVarValue
Reference the updated value.
sourcepub fn update(&self) -> bool
pub fn update(&self) -> bool
If update was explicitly requested.
Note that bindings/mappings propagate this update request.
sourcepub fn value_type(&self) -> TypeId
pub fn value_type(&self) -> TypeId
Value type ID.
Custom tag objects.
Clone the custom tag objects set by the code that updated the value.
sourcepub fn downcast_value<T: VarValue>(&self) -> Option<&T>
pub fn downcast_value<T: VarValue>(&self) -> Option<&T>
Reference the value, if it is of type T
.
Reference all custom tag values of type T
.
sourcepub fn as_strong<T: VarValue>(&self) -> Option<VarHookArgs<'_, T>>
pub fn as_strong<T: VarValue>(&self) -> Option<VarHookArgs<'_, T>>
Try cast to strongly typed args.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for VarHookArgs<'a, T>
impl<'a, T> !RefUnwindSafe for VarHookArgs<'a, T>
impl<'a, T> Send for VarHookArgs<'a, T>
impl<'a, T> Sync for VarHookArgs<'a, T>
impl<'a, T> Unpin for VarHookArgs<'a, T>
impl<'a, T> !UnwindSafe for VarHookArgs<'a, T>
Blanket Implementations§
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
§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> 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