Enum relay_protocol::Val
source · pub enum Val<'a> {
Bool(bool),
I64(i64),
U64(u64),
F64(f64),
String(&'a str),
Uuid(Uuid),
Array(Arr<'a>),
Object(Obj<'a>),
}
Expand description
Borrowed version of Value
.
Variants§
Bool(bool)
A boolean value.
I64(i64)
A signed integer value.
U64(u64)
An unsigned integer value.
F64(f64)
A floating point value.
String(&'a str)
A string value.
Uuid(Uuid)
A UUID.
Array(Arr<'a>)
An array of annotated values.
Object(Obj<'a>)
A mapping of strings to annotated values.
Implementations§
source§impl<'a> Val<'a>
impl<'a> Val<'a>
sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
Represents the value as f64
if possible. Returns None
otherwise.
sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Represents the value as f64
if possible. Returns None
otherwise.
sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Represents the value as f64
if possible. Returns None
otherwise.
Trait Implementations§
impl<'a> Copy for Val<'a>
Auto Trait Implementations§
impl<'a> Freeze for Val<'a>
impl<'a> RefUnwindSafe for Val<'a>
impl<'a> Send for Val<'a>
impl<'a> Sync for Val<'a>
impl<'a> Unpin for Val<'a>
impl<'a> UnwindSafe for Val<'a>
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
)