pub enum UValue<'value> {
Bool(bool),
Int(i32),
Real(N32),
Array(UArray<'value>),
Tuple(UTuple<'value>),
}Expand description
Value type that has been “unpacked” on its first level
Value is quite opaque in itself due to how its memory representation was designed. To read
its contents, call Value::unpack and pattern-match on the returned UValue.
Unpacked values are only unpacked on the “first level”. For instance, an unpacked tuple will
only reveal that it is a tuple and what its size is, but its field will be packed Values
that will need to be unpacked after (if needed). This makes the entire abstraction
allocation-free.
§Note
UValue is supposed to mean “unpacked value” but since we’re goin to pattern match a lot with it, I’d rather make it short to type.
Variants§
Trait Implementations§
Source§impl<'value> Ord for UValue<'value>
impl<'value> Ord for UValue<'value>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'value> PartialOrd for UValue<'value>
impl<'value> PartialOrd for UValue<'value>
impl<'value> Eq for UValue<'value>
impl<'value> StructuralPartialEq for UValue<'value>
Auto Trait Implementations§
impl<'value> Freeze for UValue<'value>
impl<'value> RefUnwindSafe for UValue<'value>
impl<'value> Send for UValue<'value>
impl<'value> Sync for UValue<'value>
impl<'value> Unpin for UValue<'value>
impl<'value> UnwindSafe for UValue<'value>
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