pub struct LocalDispatcher { /* private fields */ }Expand description
The default non-networked dispatcher
Logs network messages at the info level and local messages at the warn level,
then discards either.
Implementations§
Source§impl LocalDispatcher
impl LocalDispatcher
Sourcepub fn new(notify_ready: KPromise<()>) -> LocalDispatcher
pub fn new(notify_ready: KPromise<()>) -> LocalDispatcher
Creates a new local dispatcher
The notify_ready promise will be fulfilled, when the component
received a Start event.
Trait Implementations§
Source§impl Actor for LocalDispatcher
impl Actor for LocalDispatcher
Source§type Message = DispatchEnvelope
type Message = DispatchEnvelope
The type of local messages the actor accepts
Source§fn receive_local(&mut self, msg: Self::Message) -> HandlerResult
fn receive_local(&mut self, msg: Self::Message) -> HandlerResult
Handle an incoming local message Read more
Source§impl ComponentDefinition for LocalDispatcher
impl ComponentDefinition for LocalDispatcher
Source§fn setup(&mut self, self_component: Arc<Component<Self>>)
fn setup(&mut self, self_component: Arc<Component<Self>>)
Prepare the component for being run Read more
Source§fn execute(&mut self, _max_events: usize, _skip: usize) -> ExecuteResult
fn execute(&mut self, _max_events: usize, _skip: usize) -> ExecuteResult
Execute events on the component’s ports Read more
Source§fn ctx_mut(&mut self) -> &mut ComponentContext<Self>
fn ctx_mut(&mut self) -> &mut ComponentContext<Self>
Return a mutable reference the component’s context field
Source§fn ctx(&self) -> &ComponentContext<Self>
fn ctx(&self) -> &ComponentContext<Self>
Return a reference the component’s context field
Source§fn spawn_local<F>(
&mut self,
f: impl FnOnce(ComponentDefinitionAccess<Self>) -> F,
)
fn spawn_local<F>( &mut self, f: impl FnOnce(ComponentDefinitionAccess<Self>) -> F, )
Run a Future on this component, allowing it mutable
access to the component’s internal state on every poll. Read more
Source§impl ComponentLifecycle for LocalDispatcher
impl ComponentLifecycle for LocalDispatcher
Source§fn on_start(&mut self) -> HandlerResult
fn on_start(&mut self) -> HandlerResult
Gets invoked every time a component receives a Start event Read more
Source§fn on_stop(&mut self) -> HandlerResultwhere
Self: 'static,
fn on_stop(&mut self) -> HandlerResultwhere
Self: 'static,
Gets invoked every time a component receives a Stop event Read more
Source§fn on_kill(&mut self) -> HandlerResultwhere
Self: 'static,
fn on_kill(&mut self) -> HandlerResultwhere
Self: 'static,
Gets invoked every time a component receives a Kill event Read more
Source§impl DynamicPortAccess for LocalDispatcher
impl DynamicPortAccess for LocalDispatcher
Source§fn get_provided_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>
fn get_provided_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>
Internal API. Dynamically obtain a mutable reference to a
ProvidedPort if self
provides a port of the type indicated by the passed port_id. Read moreSource§fn get_required_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>
fn get_required_port_as_any(&mut self, port_id: TypeId) -> Option<&mut dyn Any>
Internal API. Dynamically obtain a mutable reference to a
RequiredPort if self
requires a port of the type indicated by the passed port_id. Read moreAuto Trait Implementations§
impl !Freeze for LocalDispatcher
impl !RefUnwindSafe for LocalDispatcher
impl !Sync for LocalDispatcher
impl !UnwindSafe for LocalDispatcher
impl Forget for LocalDispatcher
impl Move for LocalDispatcher
impl Send for LocalDispatcher
impl Unpin for LocalDispatcher
impl UnsafeUnpin for LocalDispatcher
Blanket Implementations§
Source§impl<A, M> ActorRaw for Awhere
M: MessageBounds,
A: Actor<Message = M>,
impl<A, M> ActorRaw for Awhere
M: MessageBounds,
A: Actor<Message = M>,
Source§impl<CD> ActorRefFactory for CDwhere
CD: ComponentDefinition,
impl<CD> ActorRefFactory for CDwhere
CD: ComponentDefinition,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<CD> ComponentLogging for CDwhere
CD: ComponentTraits + ComponentLifecycle,
impl<CD> ComponentLogging for CDwhere
CD: ComponentTraits + ComponentLifecycle,
impl<CD> ComponentTraits for CDwhere
CD: ComponentDefinition + ActorRaw + 'static,
impl<T> DynamicComponentDefinition for T
impl<T> Erased for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<CD> Timer<CD> for CDwhere
CD: ComponentTraits,
impl<CD> Timer<CD> for CDwhere
CD: ComponentTraits,
Source§fn schedule_once<F>(&mut self, timeout: Duration, action: F) -> ScheduledTimer
fn schedule_once<F>(&mut self, timeout: Duration, action: F) -> ScheduledTimer
Source§fn schedule_periodic<F>(
&mut self,
delay: Duration,
period: Duration,
action: F,
) -> ScheduledTimer
fn schedule_periodic<F>( &mut self, delay: Duration, period: Duration, action: F, ) -> ScheduledTimer
Source§fn cancel_timer(&mut self, handle: ScheduledTimer)
fn cancel_timer(&mut self, handle: ScheduledTimer)
Cancel the timer indicated by the
handle Read more