Trait mesh_node::local_node::HandlePortEvent
source · pub trait HandlePortEvent: 'static + Send {
// Required methods
fn message(&mut self, control: &mut PortControl<'_>, message: Message);
fn close(&mut self, control: &mut PortControl<'_>);
fn fail(&mut self, control: &mut PortControl<'_>, err: NodeError);
fn drain(&mut self) -> Vec<Message>;
}
Expand description
Trait implemented by port event handlers.
Such an implementation can be associated with a port by calling
Port::set_handler
.
Required Methods§
sourcefn message(&mut self, control: &mut PortControl<'_>, message: Message)
fn message(&mut self, control: &mut PortControl<'_>, message: Message)
Handles a new message for the port.
sourcefn close(&mut self, control: &mut PortControl<'_>)
fn close(&mut self, control: &mut PortControl<'_>)
Handles the port closing.
sourcefn fail(&mut self, control: &mut PortControl<'_>, err: NodeError)
fn fail(&mut self, control: &mut PortControl<'_>, err: NodeError)
Handles a port failure.