pub struct Worker { /* private fields */ }Expand description
Independently prepared native worker. Its plan is fixed before any session.
Implementations§
Source§impl Worker
impl Worker
Sourcepub fn new(
plan: Plan,
store: Arc<Store>,
opts: Opts,
base_identity: &[u8],
key_file: &Path,
timeout: Duration,
) -> Result<Self, Error>
pub fn new( plan: Plan, store: Arc<Store>, opts: Opts, base_identity: &[u8], key_file: &Path, timeout: Duration, ) -> Result<Self, Error>
Binds the compiled startup and authentication secret for pure work.
§Errors
Effects, quotient modes, private startup admission, keys or identity hashing.
Sourcepub fn serve(
&self,
listener: &TcpListener,
max_units: Option<u64>,
stop: &(dyn Fn() -> bool + Sync),
) -> Result<Usage, Error>
pub fn serve( &self, listener: &TcpListener, max_units: Option<u64>, stop: &(dyn Fn() -> bool + Sync), ) -> Result<Usage, Error>
Serves bounded authenticated units from a supplied listener until stopped.
max_units permits finite process lifetimes without a remote shutdown grant.
§Errors
Listener ownership or setup failure. Bad sessions are rejected and counted.
Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !UnwindSafe for Worker
impl Forget for Worker
impl Freeze for Worker
impl Move for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
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