Struct candid::ser::ValueSerializer[][src]

pub struct ValueSerializer { /* fields omitted */ }
Expand description

A structure for serializing Rust values to IDL.

Implementations

impl ValueSerializer[src]

pub fn new() -> Self[src]

Creates a new IDL serializer.

pub fn get_result(&self) -> &[u8][src]

Trait Implementations

impl Default for ValueSerializer[src]

fn default() -> ValueSerializer[src]

Returns the “default value” for a type. Read more

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

type Error = Error

type Compound = Compound<'a>

fn serialize_bool(self, v: bool) -> Result<()>[src]

fn serialize_int(self, v: &Int) -> Result<()>[src]

fn serialize_nat(self, v: &Nat) -> Result<()>[src]

fn serialize_nat8(self, v: u8) -> Result<()>[src]

fn serialize_nat16(self, v: u16) -> Result<()>[src]

fn serialize_nat32(self, v: u32) -> Result<()>[src]

fn serialize_nat64(self, v: u64) -> Result<()>[src]

fn serialize_int8(self, v: i8) -> Result<()>[src]

fn serialize_int16(self, v: i16) -> Result<()>[src]

fn serialize_int32(self, v: i32) -> Result<()>[src]

fn serialize_int64(self, v: i64) -> Result<()>[src]

fn serialize_float32(self, v: f32) -> Result<()>[src]

fn serialize_float64(self, v: f64) -> Result<()>[src]

fn serialize_text(self, v: &str) -> Result<()>[src]

fn serialize_null(self, _v: ()) -> Result<()>[src]

fn serialize_empty(self) -> Result<()>[src]

fn serialize_principal(self, blob: &[u8]) -> Result<()>[src]

fn serialize_function(self, blob: &[u8], meth: &str) -> Result<()>[src]

fn serialize_option<T: ?Sized>(self, v: Option<&T>) -> Result<()> where
    T: CandidType
[src]

fn serialize_variant(self, index: u64) -> Result<Self::Compound>[src]

fn serialize_struct(self) -> Result<Self::Compound>[src]

fn serialize_vec(self, len: usize) -> Result<Self::Compound>[src]

fn serialize_blob(self, blob: &[u8]) -> Result<()>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.