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>
impl<'a> Request<'a>
pub fn new(media_fd: BorrowedFd<'a>) -> Result<Self>
Sourcepub fn new_request(&self) -> Result<Self>
pub fn new_request(&self) -> Result<Self>
Allocate a new request on the same media device
Sourcepub fn init(&mut self) -> Result<()>
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.
Sourcepub fn queue(&self) -> Result<()>
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more