pub struct Mutex<T: ?Sized>(_);
Expand description

Documentation still incomplete. API similar to std::sync::Mutex.

Examples

use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
 
fn poll_shared_future<F: Future>(
    fut: &Pin<Arc<pinnable::Mutex<F>>>,
    ctx: &mut Context<'_>,
) -> Poll<F::Output> {
    fut.as_ref().lock().unwrap().as_mut().poll(ctx)
}

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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.