pub struct ValueEnvelope {
pub value: WireValue,
pub type_info: TypeInfo,
pub type_registry: TypeRegistry,
}Expand description
Complete value envelope with metadata
This is the primary exchange format for Shape values. It contains:
- The raw value (for lossless data transfer)
- Type information (for proper interpretation)
- Type registry (for metadata and display options)
Fields§
§value: WireValueThe wire-format value
type_info: TypeInfoType information
type_registry: TypeRegistryAvailable metadata items for display/parsing
Implementations§
Source§impl ValueEnvelope
impl ValueEnvelope
Sourcepub fn new(
value: WireValue,
type_info: TypeInfo,
type_registry: TypeRegistry,
) -> Self
pub fn new( value: WireValue, type_info: TypeInfo, type_registry: TypeRegistry, ) -> Self
Create a new envelope
Sourcepub fn from_value(value: WireValue) -> Self
pub fn from_value(value: WireValue) -> Self
Create an envelope with default metadata inferred from the value
Sourcepub fn default_format(&self) -> &str
pub fn default_format(&self) -> &str
Get the default format name
Sourcepub fn available_formats(&self) -> Vec<&str>
pub fn available_formats(&self) -> Vec<&str>
Get available metadata/format names
Sourcepub fn has_format(&self, name: &str) -> bool
pub fn has_format(&self, name: &str) -> bool
Check if a metadata item is available
Sourcepub fn format_default(&self) -> Result<String>
pub fn format_default(&self) -> Result<String>
Format the value using the default format
Source§impl ValueEnvelope
impl ValueEnvelope
Trait Implementations§
Source§impl Clone for ValueEnvelope
impl Clone for ValueEnvelope
Source§fn clone(&self) -> ValueEnvelope
fn clone(&self) -> ValueEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValueEnvelope
impl Debug for ValueEnvelope
Source§impl<'de> Deserialize<'de> for ValueEnvelope
impl<'de> Deserialize<'de> for ValueEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ValueEnvelope
impl PartialEq for ValueEnvelope
Source§impl Serialize for ValueEnvelope
impl Serialize for ValueEnvelope
impl StructuralPartialEq for ValueEnvelope
Auto Trait Implementations§
impl Freeze for ValueEnvelope
impl RefUnwindSafe for ValueEnvelope
impl Send for ValueEnvelope
impl Sync for ValueEnvelope
impl Unpin for ValueEnvelope
impl UnsafeUnpin for ValueEnvelope
impl UnwindSafe for ValueEnvelope
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