pub struct Value<T = Type, B = EcoVec<u8>> { /* private fields */ }Expand description
A Lustre value with its type, stored as a compact opaque value
§Usage
- Use
Value::type_of()to get the type of the value - Use
Value::unpack()to inspect the contents of the value
§Internal representation
Values are usually stored as a tuple of Type × EcoVec<u8>*. The
interpretation of the byte array is directly dependent on the type of the value. The
implementation may use unsafe code that assumes that the byte array has the correct length for a
given type.
*The type is generic over both of these, so you can have a borrowed version of a value
A given type always has a constant size that may be 0. The types respect the following encoding:
Implementations§
Trait Implementations§
Source§impl<T: Borrow<Type>, B: AsRef<[u8]>> Ord for Value<T, B>
impl<T: Borrow<Type>, B: AsRef<[u8]>> Ord for Value<T, B>
Source§impl<T: Borrow<Type>, B: AsRef<[u8]>> PartialOrd for Value<T, B>
impl<T: Borrow<Type>, B: AsRef<[u8]>> PartialOrd for Value<T, B>
impl<T: Borrow<Type>, B: AsRef<[u8]>> Eq for Value<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for Value<T, B>
impl<T, B> RefUnwindSafe for Value<T, B>where
T: RefUnwindSafe,
B: RefUnwindSafe,
impl<T, B> Send for Value<T, B>
impl<T, B> Sync for Value<T, B>
impl<T, B> Unpin for Value<T, B>
impl<T, B> UnwindSafe for Value<T, B>where
T: UnwindSafe,
B: UnwindSafe,
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