Trait iotscape::SocketTrait
source · pub trait SocketTrait: Sized {
// Required methods
fn bind(addrs: &[SocketAddr]) -> Result<Self, String>;
fn send_to(&self, buf: &[u8], addr: SocketAddr) -> Result<usize, String>;
fn recv(&mut self, buf: &mut [u8]) -> Result<usize, String>;
fn set_read_timeout(&self, timeout: Option<Duration>) -> Result<(), String>;
fn set_write_timeout(&self, timeout: Option<Duration>) -> Result<(), String>;
}
Expand description
Trait to allow various socket types to be used with IoTScapeService