Trait dcbor::CBOREncodable

source ·
pub trait CBOREncodable: Into<CBOR> {
    // Required method
    fn cbor(&self) -> CBOR;

    // Provided method
    fn cbor_data(&self) -> Vec<u8>  { ... }
}
Expand description

A type that can be encoded as CBOR.

Required Methods§

source

fn cbor(&self) -> CBOR

Returns the value in CBOR symbolic representation.

Provided Methods§

source

fn cbor_data(&self) -> Vec<u8>

Returns the value in CBOR binary representation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CBOREncodable for &str

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for bool

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for f32

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for f64

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for i8

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for i16

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for i32

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for i64

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for u8

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for u16

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for u32

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for u64

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for usize

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl CBOREncodable for Bytes

source§

fn cbor(&self) -> CBOR

source§

impl CBOREncodable for f16

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

source§

impl<T> CBOREncodable for &T
where T: CBOREncodable,

source§

fn cbor(&self) -> CBOR

source§

impl<T, const N: usize> CBOREncodable for [T; N]
where T: CBOREncodable,

source§

fn cbor(&self) -> CBOR

source§

fn cbor_data(&self) -> Vec<u8>

Implementors§