Trait slog::SerdeValue [−][src]
A value that can be serialized via serde
This is useful for implementing nested values, like sequences or structures.
Required methods
fn as_serde(&self) -> &dyn Serialize
[src]
Convert to erased_serialize::Serialize
of the underlying value,
so slog::Serializer
s can use it to serialize via serde
.
fn to_sendable(&self) -> Box<dyn SerdeValue + Send + 'static>
[src]
Convert to a boxed value that can be sent across threads
This enables functionality like slog-async
and similar.
Provided methods
fn serialize_fallback(
&self,
_key: Key,
_serializer: &mut dyn Serializer
) -> Result<()>
[src]
&self,
_key: Key,
_serializer: &mut dyn Serializer
) -> Result<()>
Serialize the value in a way that is compatible with slog::Serializer
s
that do not support serde.
The implementation should not call slog::Serialize::serialize
on itself, as it will lead to infinite recursion.
Default implementation is provided, but it returns error, so use it
only for internal types in systems and libraries where serde
is always
enabled.