Enum netidx_netproto::value::Value
source · [−]pub enum Value {
}
Variants
U32(u32)
full 4 byte u32
V32(u32)
LEB128 varint, 1 - 5 bytes depending on value
I32(i32)
full 4 byte i32
Z32(i32)
LEB128 varint zigzag encoded, 1 - 5 bytes depending on abs(value)
U64(u64)
full 8 byte u64
V64(u64)
LEB128 varint, 1 - 10 bytes depending on value
I64(i64)
full 8 byte i64
Z64(i64)
LEB128 varint zigzag encoded, 1 - 10 bytes depending on abs(value)
F32(f32)
4 byte ieee754 single precision float
F64(f64)
8 byte ieee754 double precision float
DateTime(DateTime<Utc>)
UTC timestamp
Duration(Duration)
Duration
String(Chars)
unicode string, zero copy decode
Bytes(Bytes)
byte array, zero copy decode
True
boolean true
False
boolean false
Null
Empty value
Ok
An explicit ok
Error(Chars)
An explicit error
Array(Arc<[Value]>)
An array of values
Implementations
sourceimpl Value
impl Value
pub fn fmt_naked(&self, f: &mut Formatter<'_>) -> Result
pub fn fmt_notyp(&self, f: &mut Formatter<'_>) -> Result
pub fn fmt_ext(&self, f: &mut Formatter<'_>, esc: &[char], types: bool) -> Result
sourcepub fn cast(self, typ: Typ) -> Option<Value>
pub fn cast(self, typ: Typ) -> Option<Value>
Whatever value is attempt to turn it into the type specified
sourcepub fn cast_to<T: FromValue + Sized>(self) -> Res<T>
pub fn cast_to<T: FromValue + Sized>(self) -> Res<T>
cast value directly to any type implementing FromValue
pub fn get_as<T: FromValue + Sized>(self) -> Option<T>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<K: Into<Value>, V: Into<Value>, S: BuildHasher + Default> From<HashMap<K, V, S>> for Value
impl<K: Into<Value>, V: Into<Value>, S: BuildHasher + Default> From<HashMap<K, V, S>> for Value
sourceimpl<K: Into<Value>, V: Into<Value>, S: BuildHasher + Default> From<IndexMap<K, V, S>> for Value
impl<K: Into<Value>, V: Into<Value>, S: BuildHasher + Default> From<IndexMap<K, V, S>> for Value
sourceimpl Ord for Value
impl Ord for Value
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
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
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.