Struct smithay_client_toolkit::shm::DoubleMemPool
source · [−]pub struct DoubleMemPool { /* private fields */ }
Expand description
A Double memory pool, for convenient double-buffering
This type wraps two internal memory pool, and can be use for conveniently implementing double-buffering in your apps.
DoubleMemPool requires a implementation that is called when
one of the two internal memory pools becomes free after None
was returned from the pool()
method.
Implementations
sourceimpl DoubleMemPool
impl DoubleMemPool
sourcepub fn new<F>(shm: Attached<WlShm>, callback: F) -> Result<DoubleMemPool> where
F: FnMut(DispatchData<'_>) + 'static,
pub fn new<F>(shm: Attached<WlShm>, callback: F) -> Result<DoubleMemPool> where
F: FnMut(DispatchData<'_>) + 'static,
Create a double memory pool
sourcepub fn pool(&mut self) -> Option<&mut MemPool>
pub fn pool(&mut self) -> Option<&mut MemPool>
This method checks both its internal memory pools and returns one if that pool does not contain any buffers that are still in use by the server. If both the memory pools contain buffers that are currently in use by the server None will be returned.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DoubleMemPool
impl !Send for DoubleMemPool
impl !Sync for DoubleMemPool
impl Unpin for DoubleMemPool
impl !UnwindSafe for DoubleMemPool
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more