pub struct Any(_);
Expand description

A representation of an arbitrary serializable value, corresponding to the Conjure any type.

The type is designed to be a lossless representation of a Conjure JSON value and follows Conjure’s specifications regarding various edge cases such as base64 encoded binary values and non-finite floats. Its internal structure is opaque. Values can be converted to and from it with the Any::new and Any::deserialize_into methods, and it can be deserialized to and from JSON via its Serialize and Deserialize implementations.

Implementations

Converts a value into an Any.

Errors

Returns an error if the value’s serialize implementation returns an error or it does not serialize to a JSON-compatible representation.

Converts the Any into a typed value.

This is simply a convenience function using Any’s Deserializer implementation.

Errors

Returns an error if the type cannot be deserialized from this Any.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
The error type that can be returned if some error occurs during deserialization. Read more
Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
Hint that the Deserialize type is expecting a f32 value.
Hint that the Deserialize type is expecting a f64 value.
Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting an optional value. Read more
Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more
Hint that the Deserialize type is expecting a bool value.
Hint that the Deserialize type is expecting an i8 value.
Hint that the Deserialize type is expecting an i16 value.
Hint that the Deserialize type is expecting an i32 value.
Hint that the Deserialize type is expecting an i64 value.
Hint that the Deserialize type is expecting a u8 value.
Hint that the Deserialize type is expecting a u16 value.
Hint that the Deserialize type is expecting a u32 value.
Hint that the Deserialize type is expecting a u64 value.
Hint that the Deserialize type is expecting a char value.
Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a unit value.
Hint that the Deserialize type is expecting a unit struct with a particular name. Read more
Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more
Hint that the Deserialize type is expecting a sequence of values.
Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more
Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more
Hint that the Deserialize type is expecting a map of key-value pairs.
Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more
Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more
Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
Hint that the Deserialize type is expecting an i128 value. Read more
Hint that the Deserialize type is expecting an u128 value. Read more
Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.