[][src]Struct conjure_object::Any

pub struct Any(_);

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

impl Any[src]

pub fn new<T>(value: T) -> Result<Any, Error> where
    T: Serialize
[src]

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.

pub fn deserialize_into<T>(self) -> Result<T, Error> where
    T: DeserializeOwned
[src]

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

impl Clone for Any[src]

impl Debug for Any[src]

impl<'de> Deserialize<'de> for Any[src]

impl<'de> Deserializer<'de> for Any[src]

type Error = Error

The error type that can be returned if some error occurs during deserialization. Read more

impl Eq for Any[src]

impl Hash for Any[src]

impl Ord for Any[src]

impl PartialEq<Any> for Any[src]

impl PartialOrd<Any> for Any[src]

impl Serialize for Any[src]

impl StructuralEq for Any[src]

impl StructuralPartialEq for Any[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.