Trait ToXdr

Source
pub trait ToXdr<T: Serialize>: Sized {
    // Required method
    fn to_xdr(&self) -> Result<T>;

    // Provided methods
    fn to_writer<W: Write>(&self, w: &mut W) -> Result<()> { ... }
    fn to_base64(&self) -> Result<String> { ... }
}
Expand description

A trait to try and serialize some type into an XDR object.

Required Methods§

Source

fn to_xdr(&self) -> Result<T>

Build the object that can be serialized to XDR.

Provided Methods§

Source

fn to_writer<W: Write>(&self, w: &mut W) -> Result<()>

Serialize to the writer w.

Source

fn to_base64(&self) -> Result<String>

Serialize to base64.

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.

Implementors§