pub struct BufferLock<'a, 'b> { /* private fields */ }
Expand description
An RAII lock on the input buffer.
This type is created via Buffer::lock
or Buffer::try_lock
.
The purpose of this type is similar to std::sync::MutexGuard
-
it automatically unlocks the buffer then the lock goes out of scope.
Implementations§
Source§impl BufferLock<'_, '_>
impl BufferLock<'_, '_>
Sourcepub unsafe fn write(&mut self, data: &[u8])
pub unsafe fn write(&mut self, data: &[u8])
Write data to the buffer.
§Safety
The size of the data should be less or equal to the size of the buffer. The size of the buffer depends on the width, height, and buffer format.
The user should also account for pitch, the data is written contiguously.
Trait Implementations§
Source§impl<'a, 'b> Debug for BufferLock<'a, 'b>
impl<'a, 'b> Debug for BufferLock<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for BufferLock<'a, 'b>
impl<'a, 'b> RefUnwindSafe for BufferLock<'a, 'b>
impl<'a, 'b> !Send for BufferLock<'a, 'b>
impl<'a, 'b> !Sync for BufferLock<'a, 'b>
impl<'a, 'b> Unpin for BufferLock<'a, 'b>
impl<'a, 'b> UnwindSafe for BufferLock<'a, 'b>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more