Allocator

Trait Allocator 

Source
pub trait Allocator {
    type Buffer: Buffer;
    type Error: Error;

    // Required method
    fn create_buffer(
        &mut self,
        width: u32,
        height: u32,
        fourcc: Fourcc,
        modifiers: &[Modifier],
    ) -> Result<Self::Buffer, Self::Error>;
}
Expand description

Interface to create Buffers

Required Associated Types§

Source

type Buffer: Buffer

Buffer type produced by this allocator

Source

type Error: Error

Error type thrown if allocations fail

Required Methods§

Source

fn create_buffer( &mut self, width: u32, height: u32, fourcc: Fourcc, modifiers: &[Modifier], ) -> Result<Self::Buffer, Self::Error>

Try to create a buffer with the given dimensions and pixel format

Trait Implementations§

Source§

impl<B: Buffer, E: Error> Allocator for Box<dyn Allocator<Buffer = B, Error = E> + 'static>

Source§

type Buffer = B

Buffer type produced by this allocator
Source§

type Error = E

Error type thrown if allocations fail
Source§

fn create_buffer( &mut self, width: u32, height: u32, fourcc: Fourcc, modifiers: &[Modifier], ) -> Result<B, E>

Try to create a buffer with the given dimensions and pixel format

Implementations on Foreign Types§

Source§

impl<A: Allocator> Allocator for Rc<RefCell<A>>

Source§

type Buffer = <A as Allocator>::Buffer

Source§

type Error = <A as Allocator>::Error

Source§

fn create_buffer( &mut self, width: u32, height: u32, fourcc: Fourcc, modifiers: &[Modifier], ) -> Result<Self::Buffer, Self::Error>

Source§

impl<A: Allocator> Allocator for Arc<Mutex<A>>

Source§

type Buffer = <A as Allocator>::Buffer

Source§

type Error = <A as Allocator>::Error

Source§

fn create_buffer( &mut self, width: u32, height: u32, fourcc: Fourcc, modifiers: &[Modifier], ) -> Result<Self::Buffer, Self::Error>

Source§

impl<B: Buffer, E: Error> Allocator for Box<dyn Allocator<Buffer = B, Error = E> + 'static>

Source§

type Buffer = B

Source§

type Error = E

Source§

fn create_buffer( &mut self, width: u32, height: u32, fourcc: Fourcc, modifiers: &[Modifier], ) -> Result<B, E>

Implementors§

Source§

impl Allocator for DumbAllocator

Available on crate feature backend_drm only.
Source§

impl Allocator for VulkanAllocator

Available on crate feature backend_vulkan only.
Source§

impl<A> Allocator for DmabufAllocator<A>
where A: Allocator, <A as Allocator>::Buffer: AsDmabuf + 'static, <A as Allocator>::Error: Send + Sync + 'static, <<A as Allocator>::Buffer as AsDmabuf>::Error: Send + Sync + 'static,

Source§

impl<A: AsFd + 'static> Allocator for GbmAllocator<A>

Available on crate feature backend_gbm only.