pub trait InHandler: Send {
// Provided methods
fn on_push(
&mut self,
_logic: &mut GraphStageLogic,
_inlet: AnyInlet,
) -> StreamResult<()> { ... }
fn on_upstream_finish(
&mut self,
_logic: &mut GraphStageLogic,
_inlet: AnyInlet,
) -> StreamResult<()> { ... }
fn on_upstream_failure(
&mut self,
logic: &mut GraphStageLogic,
_inlet: AnyInlet,
cause: StreamError,
) -> StreamResult<()> { ... }
}Expand description
Reacts to events on one inlet. The default on_upstream_failure fails the
whole stage; override any method a stage needs.
Provided Methods§
Sourcefn on_push(
&mut self,
_logic: &mut GraphStageLogic,
_inlet: AnyInlet,
) -> StreamResult<()>
fn on_push( &mut self, _logic: &mut GraphStageLogic, _inlet: AnyInlet, ) -> StreamResult<()>
An element is available on the inlet — grab it.
Sourcefn on_upstream_finish(
&mut self,
_logic: &mut GraphStageLogic,
_inlet: AnyInlet,
) -> StreamResult<()>
fn on_upstream_finish( &mut self, _logic: &mut GraphStageLogic, _inlet: AnyInlet, ) -> StreamResult<()>
Upstream completed; no more elements will arrive on this inlet.
Sourcefn on_upstream_failure(
&mut self,
logic: &mut GraphStageLogic,
_inlet: AnyInlet,
cause: StreamError,
) -> StreamResult<()>
fn on_upstream_failure( &mut self, logic: &mut GraphStageLogic, _inlet: AnyInlet, cause: StreamError, ) -> StreamResult<()>
Upstream failed. Default: fail the whole stage with the same cause.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".