SerializeAttributeAccess

Trait SerializeAttributeAccess 

Source
pub trait SerializeAttributeAccess: Sized {
    type Ok;
    type Error: Error;

    // Required methods
    fn include_prefix(
        &mut self,
        should_include: IncludePrefix,
    ) -> Result<Self::Ok, Self::Error>;
    fn preferred_prefix(
        &mut self,
        preferred_prefix: Option<Prefix<'_>>,
    ) -> Result<Self::Ok, Self::Error>;
    fn end<S: Serialize>(self, value: &S) -> Result<Self::Ok, Self::Error>;
}
Expand description

A type that can be used to serialize an attribute.

Required Associated Types§

Source

type Ok

The type of the value that is returned when serialization is successful.

Source

type Error: Error

The type of the error that is returned when serialization fails.

Required Methods§

Source

fn include_prefix( &mut self, should_include: IncludePrefix, ) -> Result<Self::Ok, Self::Error>

Set whether to enforce a prefix when serializing.

Source

fn preferred_prefix( &mut self, preferred_prefix: Option<Prefix<'_>>, ) -> Result<Self::Ok, Self::Error>

Set the preferred prefix to use when serializing.

Source

fn end<S: Serialize>(self, value: &S) -> Result<Self::Ok, Self::Error>

Serialize the attribute.

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§