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: <LocalDispatcher as Actor>::Message,
) -> Result<Handled, HandlerError>
fn receive_local( &mut self, msg: <LocalDispatcher as Actor>::Message, ) -> Result<Handled, HandlerError>
Handle an incoming local message Read more
Source§fn receive_network(&mut self, msg: NetMessage) -> Result<Handled, HandlerError>
fn receive_network(&mut self, msg: NetMessage) -> Result<Handled, HandlerError>
Handle an incoming network message Read more
Source§impl ComponentDefinition for LocalDispatcher
impl ComponentDefinition for LocalDispatcher
Source§fn setup(&mut self, self_component: Arc<Component<LocalDispatcher>>)
fn setup(&mut self, self_component: Arc<Component<LocalDispatcher>>)
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<LocalDispatcher>
fn ctx_mut(&mut self) -> &mut ComponentContext<LocalDispatcher>
Return a mutable reference the component’s context field
Source§fn ctx(&self) -> &ComponentContext<LocalDispatcher>
fn ctx(&self) -> &ComponentContext<LocalDispatcher>
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§impl Dispatcher for LocalDispatcher
impl Dispatcher for LocalDispatcher
Source§fn system_path(&mut self) -> SystemPath
fn system_path(&mut self) -> SystemPath
Returns the system path for this dispatcher
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 + 'static)>
fn get_provided_port_as_any( &mut self, port_id: TypeId, ) -> Option<&mut (dyn Any + 'static)>
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 + 'static)>
fn get_required_port_as_any( &mut self, port_id: TypeId, ) -> Option<&mut (dyn Any + 'static)>
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 Send for LocalDispatcher
impl !Sync for LocalDispatcher
impl Unpin for LocalDispatcher
impl UnsafeUnpin for LocalDispatcher
impl !UnwindSafe for LocalDispatcher
Blanket Implementations§
Source§impl<CD> ActorPathFactory for CDwhere
CD: ComponentTraits,
impl<CD> ActorPathFactory for CDwhere
CD: ComponentTraits,
Source§fn actor_path(&self) -> ActorPath
fn actor_path(&self) -> ActorPath
Returns the associated actor path.
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,
Source§impl<CD> Dispatching for CDwhere
CD: ComponentTraits,
impl<CD> Dispatching for CDwhere
CD: ComponentTraits,
Source§fn dispatcher_ref(&self) -> ActorRefStrong<DispatchEnvelope>
fn dispatcher_ref(&self) -> ActorRefStrong<DispatchEnvelope>
Returns the associated dispatcher reference.
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