[][src]Trait candid::types::Serializer

pub trait Serializer: Sized {
    type Error: Error;
    type Compound: Compound<Error = Self::Error>;
    fn serialize_bool(self, v: bool) -> Result<(), Self::Error>;
fn serialize_int(self, v: &Int) -> Result<(), Self::Error>;
fn serialize_nat(self, v: &Nat) -> Result<(), Self::Error>;
fn serialize_nat8(self, v: u8) -> Result<(), Self::Error>;
fn serialize_nat16(self, v: u16) -> Result<(), Self::Error>;
fn serialize_nat32(self, v: u32) -> Result<(), Self::Error>;
fn serialize_nat64(self, v: u64) -> Result<(), Self::Error>;
fn serialize_int8(self, v: i8) -> Result<(), Self::Error>;
fn serialize_int16(self, v: i16) -> Result<(), Self::Error>;
fn serialize_int32(self, v: i32) -> Result<(), Self::Error>;
fn serialize_int64(self, v: i64) -> Result<(), Self::Error>;
fn serialize_float32(self, v: f32) -> Result<(), Self::Error>;
fn serialize_float64(self, v: f64) -> Result<(), Self::Error>;
fn serialize_text(self, v: &str) -> Result<(), Self::Error>;
fn serialize_null(self, v: ()) -> Result<(), Self::Error>;
fn serialize_empty(self) -> Result<(), Self::Error>;
fn serialize_option<T: ?Sized>(
        self,
        v: Option<&T>
    ) -> Result<(), Self::Error>
    where
        T: CandidType
;
fn serialize_struct(self) -> Result<Self::Compound, Self::Error>;
fn serialize_vec(self, len: usize) -> Result<Self::Compound, Self::Error>;
fn serialize_variant(
        self,
        index: u64
    ) -> Result<Self::Compound, Self::Error>;
fn serialize_principal(self, v: &[u8]) -> Result<(), Self::Error>; }

Associated Types

type Error: Error

type Compound: Compound<Error = Self::Error>

Loading content...

Required methods

fn serialize_bool(self, v: bool) -> Result<(), Self::Error>

fn serialize_int(self, v: &Int) -> Result<(), Self::Error>

fn serialize_nat(self, v: &Nat) -> Result<(), Self::Error>

fn serialize_nat8(self, v: u8) -> Result<(), Self::Error>

fn serialize_nat16(self, v: u16) -> Result<(), Self::Error>

fn serialize_nat32(self, v: u32) -> Result<(), Self::Error>

fn serialize_nat64(self, v: u64) -> Result<(), Self::Error>

fn serialize_int8(self, v: i8) -> Result<(), Self::Error>

fn serialize_int16(self, v: i16) -> Result<(), Self::Error>

fn serialize_int32(self, v: i32) -> Result<(), Self::Error>

fn serialize_int64(self, v: i64) -> Result<(), Self::Error>

fn serialize_float32(self, v: f32) -> Result<(), Self::Error>

fn serialize_float64(self, v: f64) -> Result<(), Self::Error>

fn serialize_text(self, v: &str) -> Result<(), Self::Error>

fn serialize_null(self, v: ()) -> Result<(), Self::Error>

fn serialize_empty(self) -> Result<(), Self::Error>

fn serialize_option<T: ?Sized>(self, v: Option<&T>) -> Result<(), Self::Error> where
    T: CandidType

fn serialize_struct(self) -> Result<Self::Compound, Self::Error>

fn serialize_vec(self, len: usize) -> Result<Self::Compound, Self::Error>

fn serialize_variant(self, index: u64) -> Result<Self::Compound, Self::Error>

fn serialize_principal(self, v: &[u8]) -> Result<(), Self::Error>

Loading content...

Implementors

impl<'a> Serializer for &'a mut ValueSerializer[src]

type Error = Error

type Compound = Compound<'a>

Loading content...