Struct Buffer

Source
#[repr(C)]
pub struct Buffer { /* private fields */ }
Expand description

Struct representing a buffer, with which to interact with the kernel.

Implementations§

Source§

impl Buffer

Source

pub fn new(type_: BufType) -> Buffer

Create a new buffer of the given type.

Source

pub fn with_planes(type_: BufType, planes: Vec<Plane>) -> Buffer

Create a new buffer of the given type.

Source

pub fn type_(&self) -> BufType

Source

pub fn index(&self) -> u32

Source

pub fn add_plane(&mut self, plane: Plane)

Source

pub fn set_request(&mut self, request: &Request)

Set a request fd to be passed alongside this buffer.

Source

pub fn set_bytesused(&mut self, num_plane: usize, bytesused: usize)

Set the bytesused field.

Source

pub fn bytesused(&mut self, num_plane: usize) -> u32

Get the bytesused field.

Source

pub fn length(&self, num_plane: usize) -> u32

Get the length field.

Source

pub fn set_offset(&mut self, offset: u32)

Set the m.offset field.

Source

pub fn is_error(&self) -> bool

Determines whether there has been an error on this buffer.

Source

pub fn offset(&self, num_plane: usize) -> u32

Get the m.offset field.

Source

pub fn dmabuf(&self) -> RawFd

Get the m.fd dmabuf.

Trait Implementations§

Source§

impl Debug for Buffer

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Buffer

Source§

fn default() -> Buffer

Returns the “default value” for a type. Read more

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.