pub enum RawValue {
Show 33 variants
Invalid,
EnumScalar(u8),
U8Scalar(u8),
U8zScalar(u8),
I8Scalar(i8),
U16Scalar(u16),
U16zScalar(u16),
I16Scalar(i16),
U32Scalar(u32),
U32zScalar(u32),
I32Scalar(i32),
U64Scalar(u64),
U64zScalar(u64),
I64Scalar(i64),
F32Scalar(f32),
F64Scalar(f64),
EnumArray(Box<[u8]>),
U8Array(Box<[u8]>),
U8zArray(Box<[u8]>),
I8Array(Box<[i8]>),
U16Array(Box<[u16]>),
U16zArray(Box<[u16]>),
I16Array(Box<[i16]>),
U32Array(Box<[u32]>),
U32zArray(Box<[u32]>),
I32Array(Box<[i32]>),
U64Array(Box<[u64]>),
U64zArray(Box<[u64]>),
I64Array(Box<[i64]>),
F32Array(Box<[f32]>),
F64Array(Box<[f64]>),
String(Box<str>),
Byte(Box<[u8]>),
}Expand description
A decoded field value.
Variants§
Invalid
All elements matched the type’s invalid sentinel.
EnumScalar(u8)
U8Scalar(u8)
U8zScalar(u8)
I8Scalar(i8)
U16Scalar(u16)
U16zScalar(u16)
I16Scalar(i16)
U32Scalar(u32)
U32zScalar(u32)
I32Scalar(i32)
U64Scalar(u64)
U64zScalar(u64)
I64Scalar(i64)
F32Scalar(f32)
F64Scalar(f64)
EnumArray(Box<[u8]>)
U8Array(Box<[u8]>)
U8zArray(Box<[u8]>)
I8Array(Box<[i8]>)
U16Array(Box<[u16]>)
U16zArray(Box<[u16]>)
I16Array(Box<[i16]>)
U32Array(Box<[u32]>)
U32zArray(Box<[u32]>)
I32Array(Box<[i32]>)
U64Array(Box<[u64]>)
U64zArray(Box<[u64]>)
I64Array(Box<[i64]>)
F32Array(Box<[f32]>)
F64Array(Box<[f64]>)
String(Box<str>)
UTF-8 string with the trailing 0x00 (and any padding) stripped.
Byte(Box<[u8]>)
Opaque byte array (single bytes that are not invalid sentinels also
land here — there is no ByteScalar variant since Byte is by
definition an array type on the wire).
Implementations§
Source§impl RawValue
impl RawValue
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
True iff the field collapsed to the invalid sentinel.
Sourcepub fn scalar_u64(&self) -> Option<u64>
pub fn scalar_u64(&self) -> Option<u64>
Best-effort cast of any single-element numeric value to u64.
Signed types are widened via two’s complement (matches the prior
components::scalar_as_u64 behavior).
Sourcepub fn scalar_f64(&self) -> Option<f64>
pub fn scalar_f64(&self) -> Option<f64>
Best-effort cast of any single-element numeric value to f64.
Trait Implementations§
impl StructuralPartialEq for RawValue
Auto Trait Implementations§
impl Freeze for RawValue
impl RefUnwindSafe for RawValue
impl Send for RawValue
impl Sync for RawValue
impl Unpin for RawValue
impl UnsafeUnpin for RawValue
impl UnwindSafe for RawValue
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