Serializable

Trait Serializable 

Source
pub trait Serializable<T: Serialize, const N: usize> {
    // Required method
    fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
       where S: Serializer;
}
Expand description

Trait for types serializable using serde_arrays

In order to serialize data using this crate, the type needs to implement this trait. While this approach has limitations in what can be supported (namely it limits support to only those types this trait is explicitly implemented on), the trade off is a significant increase in ergonomics.

If the greater flexibility lost by this approach is needed, see serde_with.

Required Methods§

Source

fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
where S: Serializer,

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.

Implementations on Foreign Types§

Source§

impl<T: Serialize, const N: usize> Serializable<T, N> for [T; N]

Source§

fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Source§

impl<T: Serialize, const N: usize, const M: usize> Serializable<T, N> for [[T; N]; M]

Source§

fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Implementors§