Struct zng_var::types::AnyWhenVarBuilder
source · pub struct AnyWhenVarBuilder { /* private fields */ }
Expand description
Manually build a ArcWhenVar<T>
from type erased parts.
Implementations§
source§impl AnyWhenVarBuilder
impl AnyWhenVarBuilder
sourcepub fn new<O: VarValue>(default: impl IntoVar<O>) -> Self
pub fn new<O: VarValue>(default: impl IntoVar<O>) -> Self
Start building with only the default value.
sourcepub fn new_any(default: BoxedAnyVar) -> AnyWhenVarBuilder
pub fn new_any(default: BoxedAnyVar) -> AnyWhenVarBuilder
Start building with already boxed var.
sourcepub fn from_var<O: VarValue>(var: &ContextualizedVar<O>) -> Self
pub fn from_var<O: VarValue>(var: &ContextualizedVar<O>) -> Self
sourcepub fn condition_count(&self) -> usize
pub fn condition_count(&self) -> usize
Returns the number of conditions set.
sourcepub fn set_default<O: VarValue>(&mut self, default: impl IntoVar<O>)
pub fn set_default<O: VarValue>(&mut self, default: impl IntoVar<O>)
Set/replace the default value.
sourcepub fn set_default_any(&mut self, default: BoxedAnyVar)
pub fn set_default_any(&mut self, default: BoxedAnyVar)
Set/replace the default value with an already typed erased var.
sourcepub fn push_any(&mut self, condition: BoxedVar<bool>, value: BoxedAnyVar)
pub fn push_any(&mut self, condition: BoxedVar<bool>, value: BoxedAnyVar)
Push a when condition already boxed and type erased.
sourcepub fn replace_extend(&mut self, other: &Self)
pub fn replace_extend(&mut self, other: &Self)
Replace the default value if other
has default and extend the conditions with clones of other
.
Trait Implementations§
source§impl Clone for AnyWhenVarBuilder
impl Clone for AnyWhenVarBuilder
Auto Trait Implementations§
impl Freeze for AnyWhenVarBuilder
impl !RefUnwindSafe for AnyWhenVarBuilder
impl Send for AnyWhenVarBuilder
impl Sync for AnyWhenVarBuilder
impl Unpin for AnyWhenVarBuilder
impl !UnwindSafe for AnyWhenVarBuilder
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
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> 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