pub struct SendExecutor { /* private fields */ }
Expand description
A multi-threaded port-based executor for Fuchsia. Requires that tasks scheduled on it
implement Send
so they can be load balanced between worker threads.
Having a SendExecutor
in scope allows the creation and polling of zircon objects, such as
[fuchsia_async::Channel
].
§Panics
SendExecutor
will panic on drop if any zircon objects attached to it are still alive. In other
words, zircon objects backed by a SendExecutor
must be dropped before it.
Implementations§
Source§impl SendExecutor
impl SendExecutor
Sourcepub fn set_worker_init(
&mut self,
worker_init: impl Fn() + Send + Sync + 'static,
)
pub fn set_worker_init( &mut self, worker_init: impl Fn() + Send + Sync + 'static, )
Set a new worker initialization callback. Will be invoked once at the start of each worker thread.
Sourcepub fn with_worker_init(self, worker_init: fn()) -> Self
pub fn with_worker_init(self, worker_init: fn()) -> Self
Apply the worker initialization callback to an owned executor, returning the executor.
The initialization callback will be invoked once at the start of each worker thread.
Trait Implementations§
Source§impl Debug for SendExecutor
impl Debug for SendExecutor
Auto Trait Implementations§
impl Freeze for SendExecutor
impl !RefUnwindSafe for SendExecutor
impl Send for SendExecutor
impl Sync for SendExecutor
impl Unpin for SendExecutor
impl !UnwindSafe for SendExecutor
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