pub enum Value {
Bytes(Bytes),
Email(EmailAddress),
Link(Link),
Id(Id),
None,
Number(Number),
String(TCString),
Tuple(Tuple<Self>),
Version(Version),
}
Expand description
A generic value enum
Variants
Bytes(Bytes)
Email(EmailAddress)
Link(Link)
Id(Id)
None
Number(Number)
String(TCString)
Tuple(Tuple<Self>)
Version(Version)
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T> FromIterator<T> for Value where
Value: From<T>,
impl<T> FromIterator<T> for Value where
Value: From<T>,
sourcefn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl FromStream for Value
impl FromStream for Value
sourceimpl<'en> IntoStream<'en> for Value
impl<'en> IntoStream<'en> for Value
sourceimpl TryCastFrom<Value> for Link
impl TryCastFrom<Value> for Link
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Bound
impl TryCastFrom<Value> for Bound
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Version
impl TryCastFrom<Value> for Version
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for bool
impl TryCastFrom<Value> for bool
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for f32
impl TryCastFrom<Value> for f32
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for f64
impl TryCastFrom<Value> for f64
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for u8
impl TryCastFrom<Value> for u8
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for u16
impl TryCastFrom<Value> for u16
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for u32
impl TryCastFrom<Value> for u32
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for u64
impl TryCastFrom<Value> for u64
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for usize
impl TryCastFrom<Value> for usize
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for i16
impl TryCastFrom<Value> for i16
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Range
impl TryCastFrom<Value> for Range
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for i32
impl TryCastFrom<Value> for i32
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for i64
impl TryCastFrom<Value> for i64
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for TCPathBuf
impl TryCastFrom<Value> for TCPathBuf
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>> TryCastFrom<Value> for (T,)
impl<T: TryCastFrom<Value>> TryCastFrom<Value> for (T,)
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>, T2: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2)
impl<T1: TryCastFrom<Value>, T2: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2)
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>, T2: TryCastFrom<Value>, T3: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2, T3)
impl<T1: TryCastFrom<Value>, T2: TryCastFrom<Value>, T3: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2, T3)
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>> TryCastFrom<Value> for Map<T>
impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Map<T>
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>> TryCastFrom<Value> for Vec<T>
impl<T: TryCastFrom<Value>> TryCastFrom<Value> for Vec<T>
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value>> TryCastFrom<Value> for Tuple<T>
impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Tuple<T>
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for ValueType
impl TryCastFrom<Value> for ValueType
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Bytes
impl TryCastFrom<Value> for Bytes
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Bytes>
fn opt_cast_from(value: Value) -> Option<Bytes>
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<Value> for EmailAddress
impl TryCastFrom<Value> for EmailAddress
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Id
impl TryCastFrom<Value> for Id
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Number
impl TryCastFrom<Value> for Number
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for TCString
impl TryCastFrom<Value> for TCString
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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<Value> for Uuid
impl TryCastFrom<Value> for Uuid
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<Self>
fn opt_cast_from(value: Value) -> 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 Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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<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
.