shex_ast::ast::serde_string_or_struct

Trait SerializeStringOrStruct

Source
pub trait SerializeStringOrStruct: Serialize {
    // Required method
    fn serialize_string_or_struct<S>(
        &self,
        serializer: S,
    ) -> Result<S::Ok, S::Error>
       where S: Serializer;
}
Expand description

Some structs can be serialized as a string, but only under certain circumstances.

Required Methods§

Source

fn serialize_string_or_struct<S>( &self, serializer: S, ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize either a string representation of this struct, or a full struct if the object cannot be represented as a string.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§