Port

Trait Port 

Source
pub trait Port<T>:
    Debug
    + MaybeNamed
    + MaybeLabeled {
    // Required methods
    fn is_closed(&self) -> bool;
    fn close(&mut self);

    // Provided methods
    fn is_open(&self) -> bool { ... }
    fn capacity(&self) -> Option<usize> { ... }
    fn max_capacity(&self) -> Option<usize> { ... }
}
Expand description

The common interface for ports, whether for input or output.

Required Methods§

Source

fn is_closed(&self) -> bool

Checks if a port is closed.

Source

fn close(&mut self)

Closes the port without dropping it.

Provided Methods§

Source

fn is_open(&self) -> bool

Checks if a port is open.

Source

fn capacity(&self) -> Option<usize>

Returns the remaining buffer capacity of the connection.

Source

fn max_capacity(&self) -> Option<usize>

Returns the maximum buffer capacity of the connection.

Implementors§

Source§

impl<T> Port<T> for Inputs<T>

Source§

impl<T> Port<T> for Outputs<T>