Trait dialectic_tokio_serde::Serializer [−][src]
The serialization end of a serialization format: an object which can serialize any Serialize
value.
This trait resembles serde::Serializer
, but is not identical to
it. Unlike serde::Serializer
, it defines the
Output
of a serializer, which should be something like Bytes
,
String
, or another output format.
Most serde::Serializer
s can be easily given an instance of
Serializer
. When implementing this trait, you should pick the most specific output format
for Output
. For instance, if you can serialize to a String
or a
Vec<u8>
, pick String
, because it implements AsRef<[u8]>
.
Associated Types
type Error
[src]
The type of errors during serialization.
type Output
[src]
The output format for serialization (e.g. Bytes
, String
, etc.).
Required methods
fn serialize<T: Serialize>(
&mut self,
item: &T
) -> Result<Self::Output, Self::Error>
[src]
&mut self,
item: &T
) -> Result<Self::Output, Self::Error>
Serialize a reference to any Serialize
value.