Enum Error

Source
pub enum Error {
Show 15 variants Io { source: Error, path: PathBuf, }, FileNotFound { path: PathBuf, source: Error, }, Ioctl { fd: RawFd, code: Error, api: c_ulong, }, NotSupportedIoctl { fd: RawFd, code: c_int, api: c_ulong, }, DeviceIsBusy { fd: RawFd, code: c_int, api: c_ulong, }, RequestIsAlreadyQueued { fd: RawFd, code: c_int, api: c_ulong, }, RequestNotContainBuffers { fd: RawFd, code: c_int, api: c_ulong, }, OutOfMemory { fd: RawFd, code: c_int, api: c_ulong, }, RequestHasInvalidData { fd: RawFd, code: c_int, api: c_ulong, }, HardwareBadState { fd: RawFd, code: c_int, api: c_ulong, }, InterfaceTypeParseError { from: u32, }, EntityFunctionsParseError { from: u32, }, EntityFlagsParseError { from: u32, }, PadFlagsParseError { from: u32, }, LinkFlagsParseError { from: u32, },
}

Variants§

§

Io

Generic io error

Fields

§source: Error
§path: PathBuf
§

FileNotFound

File not found

Fields

§path: PathBuf
§source: Error
§

Ioctl

Generic ioctl error code is constructed from std::io::Error::from_raw_os_error.

Fields

§code: Error
§

NotSupportedIoctl

The ioctl is not supported by the file descriptor.

Fields

§code: c_int
§

DeviceIsBusy

The ioctl can’t be handled because the device is busy. This is typically return while device is streaming, and an ioctl tried to change something that would affect the stream, or would require the usage of a hardware resource that was already allocated. The ioctl must not be retried without performing another action to fix the problem first (typically: stop the stream before retrying).

Fields

§code: c_int
§

RequestIsAlreadyQueued

The request was already queued or the application queued the first buffer directly, but later attempted to use a request.

Fields

§code: c_int
§

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.

Fields

§code: c_int
§

OutOfMemory

Out of memory when allocating internal data structures for a request.

Fields

§code: c_int
§

RequestHasInvalidData

Request has invalid data

Fields

§code: c_int
§

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.

Fields

§code: c_int
§

InterfaceTypeParseError

Fields

§from: u32
§

EntityFunctionsParseError

Fields

§from: u32
§

EntityFlagsParseError

parse error as crate::MediaEntityFlags

Fields

§from: u32
§

PadFlagsParseError

parse error as crate::MediaPadFlags

Fields

§from: u32
§

LinkFlagsParseError

parse error as crate::MediaLinkFlags

Fields

§from: u32

Implementations§

Source§

impl Error

Source

pub fn ioctl_error<F>(fd: F, code: c_int, api: c_ulong) -> Error
where F: AsRawFd,

Constructs an Error from an ioctl failure

§Arguments
  • fd : The file descriptor on which the ioctl error occurred.
  • code: The return code from the ioctl call.
  • api : The kind of operation that resulted in the error.
§References

https://www.kernel.org/doc/html/v6.9/userspace-api/media/gen-errors.html

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.