pub enum Value {
Bytes(Arc<[u8]>),
Email(Arc<EmailAddress>),
Link(Link),
Id(Id),
None,
Number(Number),
String(TCString),
Tuple(Tuple<Self>),
Version(Version),
}
Expand description
A generic value enum
Variants§
Bytes(Arc<[u8]>)
Email(Arc<EmailAddress>)
Link(Link)
Id(Id)
None
Number(Number)
String(TCString)
Tuple(Tuple<Self>)
Version(Version)
Implementations§
Trait Implementations§
source§impl AsType<Arc<[u8]>> for Value
impl AsType<Arc<[u8]>> for Value
source§impl AsType<Arc<EmailAddress>> for Value
impl AsType<Arc<EmailAddress>> for Value
source§fn as_type(&self) -> Option<&Arc<EmailAddress>>
fn as_type(&self) -> Option<&Arc<EmailAddress>>
Borrow this instance as an instance of
T
if possible.source§fn as_type_mut(&mut self) -> Option<&mut Arc<EmailAddress>>
fn as_type_mut(&mut self) -> Option<&mut Arc<EmailAddress>>
Borrow this instance mutably as an instance of
T
if possible.source§impl AsType<Link> for Value
impl AsType<Link> for Value
source§fn as_type_mut(&mut self) -> Option<&mut Link>
fn as_type_mut(&mut self) -> Option<&mut Link>
Borrow this instance mutably as an instance of
T
if possible.source§impl AsType<Number> for Value
impl AsType<Number> for Value
source§fn as_type_mut(&mut self) -> Option<&mut Number>
fn as_type_mut(&mut self) -> Option<&mut Number>
Borrow this instance mutably as an instance of
T
if possible.source§impl AsType<TCString> for Value
impl AsType<TCString> for Value
source§fn as_type_mut(&mut self) -> Option<&mut TCString>
fn as_type_mut(&mut self) -> Option<&mut TCString>
Borrow this instance mutably as an instance of
T
if possible.source§impl AsType<Tuple<Value>> for Value
impl AsType<Tuple<Value>> for Value
source§impl AsType<Version> for Value
impl AsType<Version> for Value
source§fn as_type_mut(&mut self) -> Option<&mut Version>
fn as_type_mut(&mut self) -> Option<&mut Version>
Borrow this instance mutably as an instance of
T
if possible.source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
source§fn 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
source§impl From<Arc<EmailAddress>> for Value
impl From<Arc<EmailAddress>> for Value
source§fn from(t: Arc<EmailAddress>) -> Self
fn from(t: Arc<EmailAddress>) -> Self
Converts to this type from the input type.
source§impl<T> FromIterator<T> for Value
impl<T> FromIterator<T> for Value
source§fn 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
source§impl FromStream for Value
impl FromStream for Value
source§impl GetSize for Value
impl GetSize for Value
source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
source§impl<'en> IntoStream<'en> for Value
impl<'en> IntoStream<'en> for Value
source§impl PartialEq for Value
impl PartialEq for Value
source§impl<T: TryCastFrom<Value>> TryCastFrom<Value> for (T,)
impl<T: TryCastFrom<Value>> TryCastFrom<Value> for (T,)
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<T1: TryCastFrom<Value>, T2: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2)
impl<T1: TryCastFrom<Value>, T2: TryCastFrom<Value>> TryCastFrom<Value> for (T1, T2)
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<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)
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Arc<[u8]>
impl TryCastFrom<Value> for Arc<[u8]>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Arc<EmailAddress>
impl TryCastFrom<Value> for Arc<EmailAddress>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Bound<Value>
impl TryCastFrom<Value> for Bound<Value>
source§impl TryCastFrom<Value> for Bytes
impl TryCastFrom<Value> for Bytes
source§impl TryCastFrom<Value> for Float
impl TryCastFrom<Value> for Float
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Host
impl TryCastFrom<Value> for Host
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Id
impl TryCastFrom<Value> for Id
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Link
impl TryCastFrom<Value> for Link
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Map<T>
impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Map<T>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Number
impl TryCastFrom<Value> for Number
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<const N: usize, T> TryCastFrom<Value> for SmallVec<[T; N]>
impl<const N: usize, T> TryCastFrom<Value> for SmallVec<[T; N]>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for String
impl TryCastFrom<Value> for String
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for TCPathBuf
impl TryCastFrom<Value> for TCPathBuf
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for TCString
impl TryCastFrom<Value> for TCString
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Tuple<T>
impl<T: Clone + TryCastFrom<Value>> TryCastFrom<Value> for Tuple<T>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Uuid
impl TryCastFrom<Value> for Uuid
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for ValueType
impl TryCastFrom<Value> for ValueType
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<T: TryCastFrom<Value>> TryCastFrom<Value> for Vec<T>
impl<T: TryCastFrom<Value>> TryCastFrom<Value> for Vec<T>
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for Version
impl TryCastFrom<Value> for Version
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for bool
impl TryCastFrom<Value> for bool
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for f32
impl TryCastFrom<Value> for f32
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for f64
impl TryCastFrom<Value> for f64
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for i16
impl TryCastFrom<Value> for i16
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for i32
impl TryCastFrom<Value> for i32
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for i64
impl TryCastFrom<Value> for i64
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for u16
impl TryCastFrom<Value> for u16
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for u32
impl TryCastFrom<Value> for u32
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for u64
impl TryCastFrom<Value> for u64
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for u8
impl TryCastFrom<Value> for u8
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl TryCastFrom<Value> for usize
impl TryCastFrom<Value> for usize
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn 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
.impl Eq 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§
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<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn 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
.