pub struct Handle { /* private fields */ }Expand description
Implementations§
Source§impl Handle
impl Handle
Sourcepub fn spawn(&self, future: impl Future<Output = ()> + 'static)
pub fn spawn(&self, future: impl Future<Output = ()> + 'static)
Run a !Send future on this worker until completion.
If the worker has already been dropped the future is dropped instead of running, like a task spawned on a shut-down runtime.
Sourcepub fn udp(
&self,
socket: impl Into<Bound>,
config: Config,
) -> Result<Socket, Error>
pub fn udp( &self, socket: impl Into<Bound>, config: Config, ) -> Result<Socket, Error>
Drive socket through this worker’s ring.
The caller configures and binds the socket (options, addresses); this
takes over receive and send. config picks the batching mechanisms.
The socket is what names this worker from here on: an
Endpoint built on it runs its tasks here,
whichever thread’s handle built it. A member of a steered reuseport
group (moq_sock::shard::Socket) brings its slot along, so the
connection ids issued through it steer back to this socket.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Handle
impl !Send for Handle
impl !Sync for Handle
impl !UnwindSafe for Handle
impl Freeze for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
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