pub enum Scalar {
Cluster(ClusterRef),
Map(Map<Self>),
Op(OpDef),
Range(Range),
Ref(Box<TCRef>),
Tuple(Tuple<Self>),
Value(Value),
}
Expand description
A scalar value, i.e. one which is always held in main memory and never split into blocks.
Variants
Cluster(ClusterRef)
Map(Map<Self>)
Op(OpDef)
Range(Range)
Ref(Box<TCRef>)
Tuple(Tuple<Self>)
Value(Value)
Implementations
sourceimpl Scalar
impl Scalar
sourcepub fn is_none(&self) -> bool
pub fn is_none(&self) -> bool
Return true
if self is an empty tuple, default link, or Value::None
.
sourcepub fn is_ref(&self) -> bool
pub fn is_ref(&self) -> bool
Return true
if this is a reference type which needs to be resolved.
sourcepub fn into_type(self, class: ScalarType) -> Option<Self>
pub fn into_type(self, class: ScalarType) -> Option<Self>
Cast this Scalar
into the specified ScalarType
, if possible.
Trait Implementations
sourceimpl AsType<Scalar> for CacheBlock
impl AsType<Scalar> for CacheBlock
sourcefn as_type_mut(&mut self) -> Option<&mut Scalar>
fn as_type_mut(&mut self) -> Option<&mut Scalar>
Borrow this instance mutably as an instance of T
if possible.
sourceimpl CastFrom<CollectionSchema> for Scalar
impl CastFrom<CollectionSchema> for Scalar
sourcefn cast_from(schema: CollectionSchema) -> Scalar
fn cast_from(schema: CollectionSchema) -> Scalar
Cast an instance of T
into an instance of Self
.
sourceimpl CastFrom<InstanceClass> for Scalar
impl CastFrom<InstanceClass> for Scalar
sourcefn cast_from(class: InstanceClass) -> Self
fn cast_from(class: InstanceClass) -> Self
Cast an instance of T
into an instance of Self
.
sourceimpl From<Scalar> for CacheBlock
impl From<Scalar> for CacheBlock
sourceimpl FromStream for Scalar
impl FromStream for Scalar
sourceimpl Instance for Scalar
impl Instance for Scalar
type Class = ScalarType
type Class = ScalarType
The Class
type of this instance
sourcefn class(&self) -> ScalarType
fn class(&self) -> ScalarType
Returns the [Class]
of this instance.
sourceimpl<'en> IntoStream<'en> for Scalar
impl<'en> IntoStream<'en> for Scalar
sourceimpl Refer for Scalar
impl Refer for Scalar
sourcefn dereference_self(self, path: &TCPathBuf) -> Self
fn dereference_self(self, path: &TCPathBuf) -> Self
Replace references to “$self” with the given relative path. Read more
sourcefn is_conditional(&self) -> bool
fn is_conditional(&self) -> bool
Return true
if this is a conditional reference (e.g. If
or Case
).
sourcefn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
Return true
if this references a write operation to a cluster other than the path given.
sourcefn reference_self(self, path: &TCPathBuf) -> Self
fn reference_self(self, path: &TCPathBuf) -> Self
Replace the given relative path with “$self”. Read more
sourcefn requires(&self, deps: &mut HashSet<Id>)
fn requires(&self, deps: &mut HashSet<Id>)
Add the dependency [Id
]s of this reference to the given set.
sourcefn resolve<'a, 'async_trait, T>(
self,
context: &'a Scope<'a, T>,
txn: &'a Txn
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>> where
'a: 'async_trait,
T: 'async_trait + ToState + Instance + Public,
Self: 'async_trait,
fn resolve<'a, 'async_trait, T>(
self,
context: &'a Scope<'a, T>,
txn: &'a Txn
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>> where
'a: 'async_trait,
T: 'async_trait + ToState + Instance + Public,
Self: 'async_trait,
Resolve this reference with respect to the given context.
sourceimpl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Scalar where
Scalar: TryCastFrom<T>,
impl<T: Instance + Display> TryCastFrom<InstanceExt<T>> for Scalar where
Scalar: TryCastFrom<T>,
sourcefn can_cast_from(instance: &InstanceExt<T>) -> bool
fn can_cast_from(instance: &InstanceExt<T>) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
fn opt_cast_from(instance: InstanceExt<T>) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Object> for Scalar
impl TryCastFrom<Object> for Scalar
sourcefn can_cast_from(object: &Object) -> bool
fn can_cast_from(object: &Object) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(object: Object) -> Option<Self>
fn opt_cast_from(object: Object) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for After
impl TryCastFrom<Scalar> for After
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Case
impl TryCastFrom<Scalar> for Case
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for TCRef
impl TryCastFrom<Scalar> for TCRef
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for IdRef
impl TryCastFrom<Scalar> for IdRef
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Link
impl TryCastFrom<Scalar> for Link
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Float
impl TryCastFrom<Scalar> for Float
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Number
impl TryCastFrom<Scalar> for Number
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for TCString
impl TryCastFrom<Scalar> for TCString
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T: Clone + TryCastFrom<Scalar>> TryCastFrom<Scalar> for Map<T>
impl<T: Clone + TryCastFrom<Scalar>> TryCastFrom<Scalar> for Map<T>
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Tuple<Scalar>
impl TryCastFrom<Scalar> for Tuple<Scalar>
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T: TryCastFrom<Scalar>> TryCastFrom<Scalar> for Vec<T>
impl<T: TryCastFrom<Scalar>> TryCastFrom<Scalar> for Vec<T>
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Tuple<Value>
impl TryCastFrom<Scalar> for Tuple<Value>
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for IfRef
impl TryCastFrom<Scalar> for IfRef
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for bool
impl TryCastFrom<Scalar> for bool
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for u64
impl TryCastFrom<Scalar> for u64
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Value
impl TryCastFrom<Scalar> for Value
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Id
impl TryCastFrom<Scalar> for Id
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for OpRef
impl TryCastFrom<Scalar> for OpRef
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for TCPathBuf
impl TryCastFrom<Scalar> for TCPathBuf
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T,)
impl<T: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T,)
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T1: TryCastFrom<Scalar>, T2: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T1, T2)
impl<T1: TryCastFrom<Scalar>, T2: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T1, T2)
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<T1: TryCastFrom<Scalar>, T2: TryCastFrom<Scalar>, T3: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T1, T2, T3)
impl<T1: TryCastFrom<Scalar>, T2: TryCastFrom<Scalar>, T3: TryCastFrom<Scalar>> TryCastFrom<Scalar> for (T1, T2, T3)
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for While
impl TryCastFrom<Scalar> for While
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for With
impl TryCastFrom<Scalar> for With
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Subject
impl TryCastFrom<Scalar> for Subject
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Bytes
impl TryCastFrom<Scalar> for Bytes
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Closure
impl TryCastFrom<Scalar> for Closure
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for OpDef
impl TryCastFrom<Scalar> for OpDef
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<Scalar> for Range
impl TryCastFrom<Scalar> for Range
sourcefn can_cast_from(scalar: &Scalar) -> bool
fn can_cast_from(scalar: &Scalar) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(scalar: Scalar) -> Option<Self>
fn opt_cast_from(scalar: Scalar) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl TryCastFrom<State> for Scalar
impl TryCastFrom<State> for Scalar
sourcefn can_cast_from(state: &State) -> bool
fn can_cast_from(state: &State) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(state: State) -> Option<Self>
fn opt_cast_from(state: State) -> Option<Self>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
impl Eq for Scalar
impl StructuralEq for Scalar
impl StructuralPartialEq for Scalar
Auto Trait Implementations
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T)
if self
can be cast into T
, otherwise None
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more