[−][src]Trait spectrusty::bus::zxinterface1::ZxNetSocket
This trait is being used by ZxNet to send and receive ZX-NET packets to and from remote parties.
Required methods
pub fn packet_data(&self) -> &[u8]ⓘ
[src]
Should return a view of the current packet being composed or received.
pub fn begin_packet(&mut self)
[src]
Signals that the new packet will be composed for sending.
pub fn push_byte(&mut self, byte: u8) -> usize
[src]
Adds a byte
to the packet data. Should return the size of the packet data after appending byte
.
pub fn outbound_index(&self) -> usize
[src]
Should return the index of the next byte to be pushed to the outbound data packet. This is the same as the byte size of the composed data packet so far.
pub fn send_packet(&mut self)
[src]
Should send the composed packet to the remote party.
pub fn recv_accept(&mut self) -> bool
[src]
Should optionally wait and get the confirmation from the remote party.
Returns true
if the remote party confirmed the received packet.
pub fn recv_packet(&mut self) -> bool
[src]
Should receive a data packet from the remote party.
Returns true
if the remote party has sent the next data packet.
pub fn pull_byte(&mut self) -> Option<u8>
[src]
Gets the next byte from the last received data packet.
Returns None
if there are no more bytes to be returned.
pub fn inbound_index(&self) -> usize
[src]
Should return the index of the next byte to be pulled from the outbound data packet.
pub fn send_accept(&mut self)
[src]
Should send the confirmation of the received packet to the remote party.