pub trait Buffers<T>where
T: ?Sized,{
type Buffer<'a>: DerefMut<Target = T>
where Self: 'a;
// Required methods
async fn get(&self) -> Option<Self::Buffer<'_>>;
fn get_immediate(&self) -> Option<Self::Buffer<'_>>;
}Expand description
A trait for getting access to a &mut T buffer, potentially awaiting until a buffer becomes available.
Required Associated Types§
Required Methods§
Sourceasync fn get(&self) -> Option<Self::Buffer<'_>>
async fn get(&self) -> Option<Self::Buffer<'_>>
Get a reference to a buffer. Might await until a buffer is available, as it might be in use by somebody else.
Depending on its internal implementation details, access to a buffer might also be denied
immediately, or after a certain amount of time (subject to the concrete implementation of the method).
In that case, the method will return None.
Sourcefn get_immediate(&self) -> Option<Self::Buffer<'_>>
fn get_immediate(&self) -> Option<Self::Buffer<'_>>
Get a reference to a buffer immediately, without waiting.
If no buffer is available, return None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".