Skip to main content

EncodableValue

Trait EncodableValue 

Source
pub trait EncodableValue {
    // Required methods
    fn encode_to(&self, tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>;
    fn encode_context_to(
        &self,
        tag_number: u8,
        buffer: &mut Vec<u8>,
    ) -> Result<()>;
}
Expand description

Trait for values that can be encoded

Required Methods§

Source

fn encode_to(&self, tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Encode with application tag

Source

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Encode with context tag

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl EncodableValue for &str

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Source§

impl EncodableValue for bool

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Source§

impl EncodableValue for f32

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Source§

impl EncodableValue for f64

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Source§

impl EncodableValue for i32

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Source§

impl EncodableValue for u32

Source§

fn encode_to(&self, _tag: ApplicationTag, buffer: &mut Vec<u8>) -> Result<()>

Source§

fn encode_context_to(&self, tag_number: u8, buffer: &mut Vec<u8>) -> Result<()>

Implementors§