pub trait WithSerializer {
type Serializer<'x>: Serializer<'x>
where Self: 'x;
// Required method
fn serializer<'ser>(
&'ser self,
name: Option<&'ser str>,
is_root: bool,
) -> Result<Self::Serializer<'ser>, Error>;
}
Expand description
Trait that defines the Serializer
for a type.
Required Associated Types§
Sourcetype Serializer<'x>: Serializer<'x>
where
Self: 'x
type Serializer<'x>: Serializer<'x> where Self: 'x
The serializer to use for this type.
Required Methods§
Sourcefn serializer<'ser>(
&'ser self,
name: Option<&'ser str>,
is_root: bool,
) -> Result<Self::Serializer<'ser>, Error>
fn serializer<'ser>( &'ser self, name: Option<&'ser str>, is_root: bool, ) -> Result<Self::Serializer<'ser>, Error>
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.