Trait runa_wayland_protocols::wayland::wl_shm_pool::v1::RequestDispatch
source · pub trait RequestDispatch<Ctx> {
type Error;
type CreateBufferFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
where Ctx: 'a;
type DestroyFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
where Ctx: 'a;
type ResizeFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
where Ctx: 'a;
// Required methods
fn create_buffer<'a>(
ctx: &'a mut Ctx,
object_id: u32,
id: NewId,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format
) -> Self::CreateBufferFut<'a>;
fn destroy<'a>(ctx: &'a mut Ctx, object_id: u32) -> Self::DestroyFut<'a>;
fn resize<'a>(
ctx: &'a mut Ctx,
object_id: u32,
size: i32
) -> Self::ResizeFut<'a>;
}
Required Associated Types§
type Error
sourcetype CreateBufferFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
where
Ctx: 'a
type CreateBufferFut<'a>: Future<Output = Result<(), Self::Error>> + 'a where Ctx: 'a
Type of future returned by create_buffer
Required Methods§
sourcefn create_buffer<'a>(
ctx: &'a mut Ctx,
object_id: u32,
id: NewId,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format
) -> Self::CreateBufferFut<'a>
fn create_buffer<'a>( ctx: &'a mut Ctx, object_id: u32, id: NewId, offset: i32, width: i32, height: i32, stride: i32, format: Format ) -> Self::CreateBufferFut<'a>
create a buffer from the pool
Create a wl_buffer object from the pool.
The buffer is created offset bytes into the pool and has width and height as specified. The stride argument specifies the number of bytes from the beginning of one row to the beginning of the next. The format is the pixel format of the buffer and must be one of those advertised through the wl_shm.format event.
A buffer will keep a reference to the pool it was created from so it is valid to destroy the pool immediately after creating a buffer from it.
sourcefn destroy<'a>(ctx: &'a mut Ctx, object_id: u32) -> Self::DestroyFut<'a>
fn destroy<'a>(ctx: &'a mut Ctx, object_id: u32) -> Self::DestroyFut<'a>
destroy the pool
Destroy the shared memory pool.
The mmapped memory will be released when all buffers that have been created from this pool are gone.
sourcefn resize<'a>(
ctx: &'a mut Ctx,
object_id: u32,
size: i32
) -> Self::ResizeFut<'a>
fn resize<'a>( ctx: &'a mut Ctx, object_id: u32, size: i32 ) -> Self::ResizeFut<'a>
change the size of the pool mapping
This request will cause the server to remap the backing memory for the pool from the file descriptor passed when the pool was created, but using the new size. This request can only be used to make the pool bigger.
This request only changes the amount of bytes that are mmapped by the server and does not touch the file corresponding to the file descriptor passed at creation time. It is the client’s responsibility to ensure that the file is at least as big as the new pool size.