Message passing
Chan
ChanOne
Port
PortOne
SharedChan
GenericChan
- A trait for things that can send multiple messages.GenericPort
- A trait for things that can receive multiple messages.GenericSmartChan
- Things that can send multiple messages and can detect when the receiver is closedPeekable
- Ports that can peek
for SharedChan<T> where <T: Send>
for ChanOne<T> where <T: Send>
for PortOne<T> where <T: Send>
of Peekable<T> for PortOne<T> where <T: Send>
of GenericChan<T> for Chan<T> where <T: Send>
of GenericSmartChan<T> for Chan<T> where <T: Send>
of SendDeferred<T> for Chan<T> where <T: Send>
of GenericPort<T> for Port<T> where <T: Send>
of Peekable<T> for Port<T> where <T: Send>
of GenericChan<T> for SharedChan<T> where <T: Send>
of GenericSmartChan<T> for SharedChan<T> where <T: Send>
of SendDeferred<T> for SharedChan<T> where <T: Send>
of Clone for SharedChan<T> where <T>
oneshot
stream
Chan
pub struct Chan<T> {
x: rtcomm::Chan<T>,
}
ChanOne
pub struct ChanOne<T> {
x: rtcomm::ChanOne<T>,
}
Port
pub struct Port<T> {
x: rtcomm::Port<T>,
}
PortOne
pub struct PortOne<T> {
x: rtcomm::PortOne<T>,
}
GenericChan
A trait for things that can send multiple messages.
send
fn send(&self, x: T)
Sends a message.
GenericPort
A trait for things that can receive multiple messages.
recv
fn recv(&self) -> T
Receives a message, or fails if the connection closes.
try_recv
fn try_recv(&self) -> Option<T>
Receives a message, or returns none
if the connection is closed or closes.
GenericSmartChan
Things that can send multiple messages and can detect when the receiver is closed
try_send
fn try_send(&self, x: T) -> bool
Sends a message, or report if the receiver has closed the connection.
Peekable
Ports that can peek
peek
fn peek(&self) -> bool
Returns true if a message is available
ChanOne<T>
where <T: Send>
send
fn send(self, val: T)
try_send
fn try_send(self, val: T) -> bool
send_deferred
fn send_deferred(self, val: T)
try_send_deferred
fn try_send_deferred(self, val: T) -> bool
PortOne<T>
where <T: Send>
recv
fn recv(self) -> T
try_recv
fn try_recv(self) -> Option<T>
Peekable<T>
for PortOne<T>
where <T: Send>
peek
fn peek(&self) -> bool
GenericChan<T>
for Chan<T>
where <T: Send>
send
fn send(&self, val: T)
GenericSmartChan<T>
for Chan<T>
where <T: Send>
try_send
fn try_send(&self, val: T) -> bool
SendDeferred<T>
for Chan<T>
where <T: Send>
send_deferred
fn send_deferred(&self, val: T)
try_send_deferred
fn try_send_deferred(&self, val: T) -> bool
GenericPort<T>
for Port<T>
where <T: Send>
recv
fn recv(&self) -> T
try_recv
fn try_recv(&self) -> Option<T>
Peekable<T>
for Port<T>
where <T: Send>
peek
fn peek(&self) -> bool
oneshot
fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>)
stream
fn stream<T: Send>() -> (Port<T>, Chan<T>)