[][src]Trait u2fframing::U2FFraming

pub trait U2FFraming {
    fn encode(&mut self, message: &[u8], buf: &mut [u8]) -> Result<usize>;
fn decode(&mut self, buf: &[u8]) -> Result<Option<Vec<u8>>>;
fn set_cmd(&mut self, cmd: u8); }

Required methods

fn encode(&mut self, message: &[u8], buf: &mut [u8]) -> Result<usize>

Encode function.

fn decode(&mut self, buf: &[u8]) -> Result<Option<Vec<u8>>>

Decode function. Will fail in case CID and CMD doesn't match stored values.

fn set_cmd(&mut self, cmd: u8)

Set the CMD field in case this struct didn't encode the packet

Loading content...

Implementors

impl U2FFraming for U2FHID[src]

impl U2FFraming for U2FWS[src]

Loading content...