pub struct Protocol<'a> { /* private fields */ }Implementations§
Source§impl<'a> Protocol<'a>
impl<'a> Protocol<'a>
pub fn new(device_address: u16, interface: Box<dyn Interface>) -> Self
pub fn tick(&mut self) -> Result<(), ProtocolError>
pub fn send_packet(&mut self, packet: &Packet) -> Result<(), ProtocolError>
pub fn add_packet_handler<'s>( &'s mut self, handler: Box<dyn FnMut(&Packet, &mut Self) + 'a>, capture_all_addresses: bool, ) -> Result<u32, ProtocolError>
pub fn remove_packet_handler(&mut self, id: u32) -> Result<(), ProtocolError>
pub fn exchange_packet<F: Fn(), R: ConvertPacket<R>>( &mut self, packet: Packet, capture_all_addresses: bool, wait_closure: F, ) -> Result<R, ProtocolError>
pub fn exchange_packets<F: Fn(), R: ConvertPacket<R>>( &mut self, packet: Packet, capture_all_addresses: bool, wait_closure: F, ) -> Result<Vec<R>, ProtocolError>
Auto Trait Implementations§
impl<'a> Freeze for Protocol<'a>
impl<'a> !RefUnwindSafe for Protocol<'a>
impl<'a> !Send for Protocol<'a>
impl<'a> !Sync for Protocol<'a>
impl<'a> Unpin for Protocol<'a>
impl<'a> !UnwindSafe for Protocol<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more