Struct ross_protocol::protocol::Protocol
source · [−]pub struct Protocol<'a, I: Interface> { /* private fields */ }Implementations
sourceimpl<'a, I: Interface> Protocol<'a, I>
impl<'a, I: Interface> Protocol<'a, I>
pub fn new(device_address: u16, interface: I) -> 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) + Send + '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, I> !RefUnwindSafe for Protocol<'a, I>
impl<'a, I> Send for Protocol<'a, I> where
I: Send,
impl<'a, I> !Sync for Protocol<'a, I>
impl<'a, I> Unpin for Protocol<'a, I> where
I: Unpin,
impl<'a, I> !UnwindSafe for Protocol<'a, I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more