netlink_packet_route/link/
wireless.rsuse netlink_packet_utils::{DecodeError, Emitable, Parseable};
#[derive(Debug, PartialEq, Eq, Clone, Default)]
#[non_exhaustive]
pub struct LinkWirelessEvent(Vec<u8>);
impl<T: AsRef<[u8]> + ?Sized> Parseable<T> for LinkWirelessEvent {
type Error = DecodeError;
fn parse(buf: &T) -> Result<Self, DecodeError> {
Ok(LinkWirelessEvent(buf.as_ref().to_vec()))
}
}
impl Emitable for LinkWirelessEvent {
fn buffer_len(&self) -> usize {
self.0.len()
}
fn emit(&self, buffer: &mut [u8]) {
buffer.copy_from_slice(self.0.as_slice())
}
}