Skip to main content

Request

Struct Request 

Source
pub struct Request<'a> { /* private fields */ }
Expand description

A request associated with a media device.

§Details

This is a wrapper for the media control API’s request, which is tied to a specific media device.

Implementations§

Source§

impl<'a> Request<'a>

Source

pub fn new(media_fd: BorrowedFd<'a>) -> Result<Self>

Source

pub fn new_request(&self) -> Result<Self>

Allocate a new request on the same media device

Source

pub fn init(&mut self) -> Result<()>

Initializes the request for recycling without re-allocating it.

§Details

Reinitializes the request, provided that it has not been queued yet or that it has already been queued and completed. After reinitialization, the request is ready to be queued again for subsequent operations.

§Errors

If the request is still queued and has not yet completed, this function returns error::Error::DeviceIsBusy. No other errors are possible.

Source

pub fn queue(&self) -> Result<()>

Enqueue the request

§Errors
  • RequestIsAlreadyQueued : The request was already queued or the application queued the first buffer directly, but later attempted to use a request. It is not permitted to mix the two APIs.
  • RequestNotContainBuffers : The request did not contain any buffers. All requests are required to have at least one buffer. This can also be returned if some required configuration is missing in the request.
  • OutOfMemory : Out of memory when allocating internal data structures for this request.
  • RequestHasInvalidData : The request has invalid data.
  • HardwareBadState : The hardware is in a bad state. To recover, the application needs to stop streaming to reset the hardware state and then try to restart streaming.

Trait Implementations§

Source§

impl<'a> Debug for Request<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Request<'a>

§

impl<'a> RefUnwindSafe for Request<'a>

§

impl<'a> Send for Request<'a>

§

impl<'a> Sync for Request<'a>

§

impl<'a> Unpin for Request<'a>

§

impl<'a> UnsafeUnpin for Request<'a>

§

impl<'a> UnwindSafe for Request<'a>

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.