Skip to main content

ItemObjectEncodable

Trait ItemObjectEncodable 

Source
pub trait ItemObjectEncodable {
    // Required methods
    fn label(&self) -> &str;
    fn write_object_onto(&self, b: &mut Vec<u8>) -> Result<(), Bug>;
}
Expand description

An Object value that be encoded into a netdoc

Required Methods§

Source

fn label(&self) -> &str

The label (keyword(s) in BEGIN and END)

Source

fn write_object_onto(&self, b: &mut Vec<u8>) -> Result<(), Bug>

Represent the actual value as bytes.

The caller, not the object, is responsible for base64 encoding.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ItemObjectEncodable for PublicKey

Source§

fn label(&self) -> &str

Source§

fn write_object_onto(&self, b: &mut Vec<u8>) -> Result<(), Bug>

Source§

impl ItemObjectEncodable for Void

Source§

fn label(&self) -> &str

Source§

fn write_object_onto(&self, _: &mut Vec<u8>) -> Result<(), Bug>

Source§

impl<T: ItemObjectEncodable> ItemObjectEncodable for Arc<T>

Source§

fn label(&self) -> &str

Source§

fn write_object_onto(&self, b: &mut Vec<u8>) -> Result<(), Bug>

Implementors§