pub enum DIFValueRepresentation {
Null,
Boolean(bool),
String(String),
Number(f64),
Array(Vec<DIFValueContainer>),
Map(Vec<(DIFValueContainer, DIFValueContainer)>),
Object(Vec<(String, DIFValueContainer)>),
}Variants§
Null
Boolean(bool)
Represents a boolean value in DIF.
String(String)
Represents a string value in DIF.
Number(f64)
Represents a number in DIF.
Array(Vec<DIFValueContainer>)
Represents a array of DIF values.
Map(Vec<(DIFValueContainer, DIFValueContainer)>)
Represents a map of DIF values.
Object(Vec<(String, DIFValueContainer)>)
Represents a struct value in DIF.
Implementations§
Source§impl DIFValueRepresentation
impl DIFValueRepresentation
Sourcepub fn to_default_value(
&self,
memory: &RefCell<Memory>,
) -> Result<Value, DIFReferenceNotFoundError>
pub fn to_default_value( &self, memory: &RefCell<Memory>, ) -> Result<Value, DIFReferenceNotFoundError>
Converts a DIFRepresentationValue into a default Value, without considering additional type information. Returns an error if a reference cannot be resolved.
Sourcepub fn to_value_with_type(
&self,
type_definition: &DIFTypeDefinition,
memory: &RefCell<Memory>,
) -> Result<Value, DIFReferenceNotFoundError>
pub fn to_value_with_type( &self, type_definition: &DIFTypeDefinition, memory: &RefCell<Memory>, ) -> Result<Value, DIFReferenceNotFoundError>
Converts a DIFValueRepresentation into a Value, using the provided type information to guide the conversion. Returns an error if a reference cannot be resolved.
Trait Implementations§
Source§impl Clone for DIFValueRepresentation
impl Clone for DIFValueRepresentation
Source§fn clone(&self) -> DIFValueRepresentation
fn clone(&self) -> DIFValueRepresentation
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 DIFValueRepresentation
impl Debug for DIFValueRepresentation
Source§impl<'de> Deserialize<'de> for DIFValueRepresentation
impl<'de> Deserialize<'de> for DIFValueRepresentation
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 From<DIFValueRepresentation> for DIFValue
impl From<DIFValueRepresentation> for DIFValue
Source§fn from(value: DIFValueRepresentation) -> Self
fn from(value: DIFValueRepresentation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DIFValueRepresentation
impl PartialEq for DIFValueRepresentation
Source§impl Serialize for DIFValueRepresentation
impl Serialize for DIFValueRepresentation
impl StructuralPartialEq for DIFValueRepresentation
Auto Trait Implementations§
impl Freeze for DIFValueRepresentation
impl RefUnwindSafe for DIFValueRepresentation
impl Send for DIFValueRepresentation
impl Sync for DIFValueRepresentation
impl Unpin for DIFValueRepresentation
impl UnsafeUnpin for DIFValueRepresentation
impl UnwindSafe for DIFValueRepresentation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more