Trait DPT

Source
pub trait DPT {
    // Required methods
    fn encode(&self, buf: &mut Vec<u8>);
    fn decode(&mut self, buf: &[u8]) -> Result<(), KnxNetIpError>
       where Self: Sized;
    fn bit_len(&self) -> u16;

    // Provided method
    fn unit(&self) -> &str { ... }
}

Required Methods§

Source

fn encode(&self, buf: &mut Vec<u8>)

Source

fn decode(&mut self, buf: &[u8]) -> Result<(), KnxNetIpError>
where Self: Sized,

Source

fn bit_len(&self) -> u16

Provided Methods§

Source

fn unit(&self) -> &str

Implementations on Foreign Types§

Source§

impl DPT for bool

Source§

fn encode(&self, buf: &mut Vec<u8>)

Source§

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

Source§

fn bit_len(&self) -> u16

Source§

impl DPT for u16

Source§

fn encode(&self, buf: &mut Vec<u8>)

Source§

fn decode(&mut self, buf: &[u8]) -> Result<(), KnxNetIpError>
where Self: Sized,

Source§

fn bit_len(&self) -> u16

Source§

impl DPT for ()

Source§

fn encode(&self, buf: &mut Vec<u8>)

Source§

fn decode(&mut self, buf: &[u8]) -> Result<(), KnxNetIpError>
where Self: Sized,

Source§

fn bit_len(&self) -> u16

Source§

impl DPT for Vec<u8>

Source§

fn encode(&self, buf: &mut Vec<u8>)

Source§

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

Source§

fn bit_len(&self) -> u16

Implementors§