pub struct CallMonitor { /* private fields */ }Expand description
A running call monitor. It stops when dropped.
Implementations§
Source§impl CallMonitor
impl CallMonitor
Sourcepub async fn start(sessions: Vec<Vec<String>>) -> Result<Self>
pub async fn start(sessions: Vec<Vec<String>>) -> Result<Self>
Listens on a free port of the loopback interface. Each connection
gets the lines of the next session, each ended with \r\n like the
device does, and is closed after them, except the one of the last
session, which stays open. Lines can be anything, like events that
are not valid; sessions can repeat the lines of the one before, like
a device that would send them again.
§Errors
The errors of binding the port.
§Panics
The server task panics if it cannot accept a connection on loopback.
Sourcepub fn connections(&self) -> usize
pub fn connections(&self) -> usize
How many connections it accepted so far.
Trait Implementations§
Source§impl Debug for CallMonitor
impl Debug for CallMonitor
Source§impl Drop for CallMonitor
impl Drop for CallMonitor
Auto Trait Implementations§
impl Forget for CallMonitor
impl Freeze for CallMonitor
impl Move for CallMonitor
impl RefUnwindSafe for CallMonitor
impl Send for CallMonitor
impl Sync for CallMonitor
impl Unpin for CallMonitor
impl UnsafeUnpin for CallMonitor
impl UnwindSafe for CallMonitor
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