pub enum WireValue {
Null,
Int(i32),
BigInt(i64),
Float(f64),
Text(String),
Bool(bool),
Vector(Vec<f32>),
}Expand description
One value as it travels on the wire. Mirrors spg-storage::Value but
spg-wire is dep-free of storage — callers convert at the boundary.
Variants§
Implementations§
Source§impl WireValue
impl WireValue
pub const fn wire_type(&self) -> WireType
pub fn encode(&self, out: &mut Vec<u8>) -> Result<(), FrameError>
Sourcepub fn decode(buf: &[u8], off: usize) -> Result<(Self, usize), FrameError>
pub fn decode(buf: &[u8], off: usize) -> Result<(Self, usize), FrameError>
Decode one WireValue starting at buf[off]; returns the value and
the byte offset after it. ShortPayload/TruncatedPayload mean the
caller should accumulate more bytes (during streaming) — but inside a
fully-buffered frame they’re a hard error.
Trait Implementations§
impl StructuralPartialEq for WireValue
Auto Trait Implementations§
impl Freeze for WireValue
impl RefUnwindSafe for WireValue
impl Send for WireValue
impl Sync for WireValue
impl Unpin for WireValue
impl UnsafeUnpin for WireValue
impl UnwindSafe for WireValue
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