Struct iotscape::MockSocket
source · pub struct MockSocket {
pub data: VecDeque<Vec<u8>>,
}Expand description
SocketTrait impl with an internal message queue for testing purposes
Fields§
§data: VecDeque<Vec<u8>>Trait Implementations§
source§impl SocketTrait for MockSocket
impl SocketTrait for MockSocket
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>
Auto Trait Implementations§
impl RefUnwindSafe for MockSocket
impl Send for MockSocket
impl Sync for MockSocket
impl Unpin for MockSocket
impl UnwindSafe for MockSocket
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