[][src]Trait redox_buffer_pool::Guard

pub trait Guard {
    fn try_release(&self) -> bool;
}

The requirement of a guard to a slice. Guards can optionally prevent slices from being reclaimed; the slices have a fallible BufferSlice::reclaim method, but their Drop impl will cause the memory to leak if it's still protected by the guard. This is especially useful when the buffers are shared with another process (io_uring for instance), or by hardware, since this prevents data races that could occur, if a new buffer for a different purpose happens to use the same memory as an old buffer that hardware e.g. thinks it can write to.

Required methods

fn try_release(&self) -> bool

Try to release the guard, returning either true for success or false for failure.

Loading content...

Implementors

impl Guard for NoGuard[src]

Loading content...