[−][src]Trait rust_ether::PacketTransfer
A packet transfer protocol. It is similear to StreamTransfer
trait but provides a tag
for transfer index.
Required methods
fn connect(&mut self) -> Result<(), String>
Connect to host. Most implments should make sure the server / other peer is avaliable.
fn peek(&mut self, tag: &str) -> Result<Option<Vec<u8>>, String>
Try to receive a data packet.
fn send(&mut self, tag: &str, data: Vec<u8>) -> Result<(), String>
Try to send a data packet to the server / other peer.
fn remove(&mut self, tag: &str) -> Result<(), String>
Remove the packet from the queue.
Provided methods
fn recv(&mut self, tag: &str) -> Result<Option<Vec<u8>>, String>
Try to receive a data packet and remove it.