pub struct Buffer {
pub id: u32,
pub width: u32,
pub height: u32,
pub stride: u32,
pub format: PixelFormat,
pub pool_id: u32,
pub pool_buffer_id: u32,
}Expand description
Legacy buffer struct retained for surface.rs compatibility.
New code should use WlBuffer + pool references.
Fields§
§id: u32Buffer ID
width: u32Width in pixels
height: u32Height in pixels
stride: u32Stride (bytes per row)
format: PixelFormatPixel format
pool_id: u32Pool ID that owns this buffer’s pixel data
pool_buffer_id: u32Buffer ID within the pool
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub fn new(id: u32, width: u32, height: u32, format: PixelFormat) -> Self
pub fn new(id: u32, width: u32, height: u32, format: PixelFormat) -> Self
Create a new buffer descriptor.
Sourcepub fn from_pool(
id: u32,
pool_id: u32,
pool_buffer_id: u32,
width: u32,
height: u32,
stride: u32,
format: PixelFormat,
) -> Self
pub fn from_pool( id: u32, pool_id: u32, pool_buffer_id: u32, width: u32, height: u32, stride: u32, format: PixelFormat, ) -> Self
Create a buffer linked to a pool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)