openvm_algebra_guest

Trait BigArray

Source
pub trait BigArray<'de, T>: Sized {
    // Required methods
    fn serialize<S>(
        &self,
        serializer: S,
    ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
       where S: Serializer,
             T: Serialize;
    fn deserialize<D>(
        deserializer: D,
    ) -> Result<Self, <D as Deserializer<'de>>::Error>
       where D: Deserializer<'de>,
             T: Deserialize<'de>;
}
Expand description

The big array serialization helper trait

#[derive(Serialize, Deserialize)]
struct S {
    #[serde(with = "BigArray")]
    arr: [u8; 64],
}

Required Methods§

Source

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer, T: Serialize,

Source

fn deserialize<D>( deserializer: D, ) -> Result<Self, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>, T: Deserialize<'de>,

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<'de, T, const N: usize> BigArray<'de, T> for [T; N]

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer, T: Serialize,

Source§

fn deserialize<D>( deserializer: D, ) -> Result<[T; N], <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>, T: Deserialize<'de>,

Implementors§