Struct ockam_node::WorkerBuilder
source · [−]pub struct WorkerBuilder<W> { /* private fields */ }
Expand description
Start a Worker
with a custom AccessControl
configuration
Any incoming messages for the worker will first be subject to the
configured AccessControl
before it is passed on to
Worker::handle_message
.
The Context::start_worker()
function wraps this type and
simply calls WorkerBuilder::with_context_access_control()
.
Varying use-cases should use the builder API to customise the underlying worker that is created.
Implementations
sourceimpl<M, W> WorkerBuilder<W> where
M: Message + Send + 'static,
W: Worker<Context = Context, Message = M>,
impl<M, W> WorkerBuilder<W> where
M: Message + Send + 'static,
W: Worker<Context = Context, Message = M>,
sourcepub fn without_access_control<AS>(address_set: AS, worker: W) -> Self where
AS: Into<AddressSet>,
pub fn without_access_control<AS>(address_set: AS, worker: W) -> Self where
AS: Into<AddressSet>,
Create a worker with AllowAll
access control
sourcepub fn with_inherited_access_control<AS>(
context: &Context,
address_set: AS,
worker: W
) -> Self where
AS: Into<AddressSet>,
pub fn with_inherited_access_control<AS>(
context: &Context,
address_set: AS,
worker: W
) -> Self where
AS: Into<AddressSet>,
Create a worker which inherits access control from the given context
sourcepub fn with_access_control<A, AC>(
access_control: AC,
address: A,
worker: W
) -> Self where
A: Into<Address>,
AC: AccessControl,
pub fn with_access_control<A, AC>(
access_control: AC,
address: A,
worker: W
) -> Self where
A: Into<Address>,
AC: AccessControl,
Create a worker which uses the given access control
sourcepub fn with_mailboxes(mailboxes: Mailboxes, worker: W) -> Self
pub fn with_mailboxes(mailboxes: Mailboxes, worker: W) -> Self
Create a worker which uses the access control from the given
Mailboxes
Auto Trait Implementations
impl<W> !RefUnwindSafe for WorkerBuilder<W>
impl<W> Send for WorkerBuilder<W> where
W: Send,
impl<W> Sync for WorkerBuilder<W> where
W: Sync,
impl<W> Unpin for WorkerBuilder<W> where
W: Unpin,
impl<W> !UnwindSafe for WorkerBuilder<W>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more