Struct ockam_node::WorkerBuilder
source · pub struct WorkerBuilder<W> { /* private fields */ }Expand description
Start a Worker with a custom IncomingAccessControl and OutgoingAccessControl 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_inherited_access_control().
Varying use-cases should use the builder API to customise the underlying worker that is created.
Implementations§
source§impl<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 with_access_control(
incoming_access_control: Arc<dyn IncomingAccessControl>,
outgoing_access_control: Arc<dyn OutgoingAccessControl>,
address: impl Into<Address>,
worker: W
) -> Self
pub fn with_access_control( incoming_access_control: Arc<dyn IncomingAccessControl>, outgoing_access_control: Arc<dyn OutgoingAccessControl>, address: impl Into<Address>, worker: W ) -> Self
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§
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