Struct rustfbp::component::OutputSender
[−]
[src]
pub struct OutputSender<T> { // some fields omitted }
Represent a output port.
It allows to connect the port and send an IP through it.
Example
let (s, r) = sync_channel(16); let os = OutputSender::<i32>::new(); os.connect(s); os.send(23); assert_eq!(r.recv().unwrap(), 23);
Methods
impl<T> OutputSender<T>
[src]
fn new() -> Self
Create a new unconnected OutputSender structure.
fn connect(&mut self, send: CountSender<T>)
Connect the OutputSener structure with the given SyncSender
fn remove(self) -> Option<CountSender<T>>
Remove
fn disconnect(&mut self)
Disconect
fn send(&self, msg: T) -> Result<(), OutputPortError<T>>
Send a message to the OutputPort. If the port is unconnected, it return a OutputPortError::NotConnected. If there is an error while the transfer, it return the corresponding SendError message.