pub enum Value {
Show 20 variants
Bool(bool),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
S8(i8),
S16(i16),
S32(i32),
S64(i64),
F32(f32),
F64(f64),
Char(char),
String(String),
List {
elem_type: ValueType,
items: Vec<Value>,
},
Option {
inner_type: ValueType,
value: Option<Box<Value>>,
},
Result {
ok_type: ValueType,
err_type: ValueType,
value: Result<Box<Value>, Box<Value>>,
},
Record {
type_name: String,
fields: Vec<(String, Value)>,
},
Variant {
type_name: String,
case_name: String,
tag: usize,
payload: Vec<Value>,
},
Tuple(Vec<Value>),
Flags(u64),
}Expand description
A runtime value that can be passed across package boundaries
Variants§
Bool(bool)
U8(u8)
U16(u16)
U32(u32)
U64(u64)
S8(i8)
S16(i16)
S32(i32)
S64(i64)
F32(f32)
F64(f64)
Char(char)
String(String)
List
Option
Result
Record
Variant
Tuple(Vec<Value>)
Flags(u64)
Implementations§
Source§impl Value
impl Value
Trait Implementations§
Source§impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>> From<(A, B, C, D)> for Value
impl<A: Into<Value>, B: Into<Value>, C: Into<Value>, D: Into<Value>> From<(A, B, C, D)> for Value
Source§fn from((a, b, c, d): (A, B, C, D)) -> Self
fn from((a, b, c, d): (A, B, C, D)) -> Self
Converts to this type from the input type.
Source§impl<K: Into<Value> + KnownValueType + Ord, V: Into<Value> + KnownValueType> From<BTreeMap<K, V>> for Value
impl<K: Into<Value> + KnownValueType + Ord, V: Into<Value> + KnownValueType> From<BTreeMap<K, V>> for Value
Source§impl<T: Into<Value> + KnownValueType, E: Into<Value> + KnownValueType> From<Result<T, E>> for Value
impl<T: Into<Value> + KnownValueType, E: Into<Value> + KnownValueType> From<Result<T, E>> for Value
Source§impl FromValue for Value
FromValue implementation for Value itself (identity conversion)
impl FromValue for Value
FromValue implementation for Value itself (identity conversion)
fn from_value(v: Value) -> Result<Self, ConversionError>
Source§impl GraphCodec for Value
impl GraphCodec for Value
Source§impl KnownValueType for Value
Value is dynamic — its actual ValueType is only known at runtime
(Value::infer_type). The compile-time fallback is String, matching
the previous PackType for Value behavior. Prefer concrete types when
you need accurate static typing.
impl KnownValueType for Value
Value is dynamic — its actual ValueType is only known at runtime
(Value::infer_type). The compile-time fallback is String, matching
the previous PackType for Value behavior. Prefer concrete types when
you need accurate static typing.
fn known_value_type() -> ValueType
Source§impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B)
impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B)
Source§impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>, C: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B, C)
impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>, C: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B, C)
Source§impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>, C: TryFrom<Value, Error = ConversionError>, D: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B, C, D)
impl<A: TryFrom<Value, Error = ConversionError>, B: TryFrom<Value, Error = ConversionError>, C: TryFrom<Value, Error = ConversionError>, D: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for (A, B, C, D)
Source§impl<K: TryFrom<Value, Error = ConversionError> + Ord, V: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for BTreeMap<K, V>
impl<K: TryFrom<Value, Error = ConversionError> + Ord, V: TryFrom<Value, Error = ConversionError>> TryFrom<Value> for BTreeMap<K, V>
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for 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