[−][src]Trait maybe_serde::MaybeSer
Maybe implement Serialize
This trait is impl for all types
If type implement Serialize
then maybe_serialize
return Serialize::serialize
value with Some
Otherwise if type doesn't implement Serialize
then maybe_serialize
return just None
Associated Constants
const IMPL_SERIALIZE: bool
true if implement serde::Serialize
Required methods
fn maybe_serialize<S>(&self, serializer: S) -> Option<Result<S::Ok, S::Error>> where
S: Serializer,
S: Serializer,
Implementors
impl<T> MaybeSer for T
[src]
Always return None
const IMPL_SERIALIZE: bool
[src]
Always return false
fn maybe_serialize<S>(
&self,
_serializer: S
) -> Option<Result<<S as Serializer>::Ok, <S as Serializer>::Error>> where
S: Serializer,
[src]
&self,
_serializer: S
) -> Option<Result<<S as Serializer>::Ok, <S as Serializer>::Error>> where
S: Serializer,
impl<T> MaybeSer for T where
T: Serialize,
[src]
T: Serialize,
Always return Some
const IMPL_SERIALIZE: bool
[src]
Always return true
fn maybe_serialize<S>(
&self,
serializer: S
) -> Option<Result<<S as Serializer>::Ok, <S as Serializer>::Error>> where
S: Serializer,
[src]
&self,
serializer: S
) -> Option<Result<<S as Serializer>::Ok, <S as Serializer>::Error>> where
S: Serializer,