pub struct Yield;
Available on crate feature std only.
Expand description

A strategy that yields the current time slice to the scheduler in favour of other threads or processes.

This is generally used as a strategy for minimising power consumption and priority inversion on targets that have a standard library available. Note that such targets have scheduler-integrated concurrency primitives available, and you should generally use these instead, except in rare circumstances.

Trait Implementations

Perform the relaxing operation during a period of contention.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.