Trait erlang_port::PortReceive [−][src]
pub trait PortReceive { fn receive<T>(&mut self) -> Option<T>
where
T: MessageDeserialize; fn iter<'a, T>(&'a mut self) -> MessageIterator<'a, Self, T>
where
Self: Sized, { ... } }
PortReceive
allows an app to receive messages through an Erlang port.
Required Methods
fn receive<T>(&mut self) -> Option<T> where
T: MessageDeserialize,
T: MessageDeserialize,
Receives a single message over the port.
If there are no more messages returns None. If there's a problem reading the message it will panic.
A MessageDeserialize
implementation shold exist for the message we are
reading. We provide a serde_eetf
based default implementation for any
type implementing serdes DeserializeOwned
.
Provided Methods
ⓘImportant traits for MessageIterator<'a, R, T>
fn iter<'a, T>(&'a mut self) -> MessageIterator<'a, Self, T> where
Self: Sized,
Self: Sized,
Creates an Iterator over a series of messages read from the port.
Implementors
impl<R> PortReceive for PacketReceiver<R> where
R: Read,