#[repr(u32)]
pub enum _NVENCSTATUS {
Show 27 variants NV_ENC_SUCCESS, NV_ENC_ERR_NO_ENCODE_DEVICE, NV_ENC_ERR_UNSUPPORTED_DEVICE, NV_ENC_ERR_INVALID_ENCODERDEVICE, NV_ENC_ERR_INVALID_DEVICE, NV_ENC_ERR_DEVICE_NOT_EXIST, NV_ENC_ERR_INVALID_PTR, NV_ENC_ERR_INVALID_EVENT, NV_ENC_ERR_INVALID_PARAM, NV_ENC_ERR_INVALID_CALL, NV_ENC_ERR_OUT_OF_MEMORY, NV_ENC_ERR_ENCODER_NOT_INITIALIZED, NV_ENC_ERR_UNSUPPORTED_PARAM, NV_ENC_ERR_LOCK_BUSY, NV_ENC_ERR_NOT_ENOUGH_BUFFER, NV_ENC_ERR_INVALID_VERSION, NV_ENC_ERR_MAP_FAILED, NV_ENC_ERR_NEED_MORE_INPUT, NV_ENC_ERR_ENCODER_BUSY, NV_ENC_ERR_EVENT_NOT_REGISTERD, NV_ENC_ERR_GENERIC, NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY, NV_ENC_ERR_UNIMPLEMENTED, NV_ENC_ERR_RESOURCE_REGISTER_FAILED, NV_ENC_ERR_RESOURCE_NOT_REGISTERED, NV_ENC_ERR_RESOURCE_NOT_MAPPED, NV_ENC_ERR_NEED_MORE_OUTPUT,
}

Variants§

§

NV_ENC_SUCCESS

§

NV_ENC_ERR_NO_ENCODE_DEVICE

§

NV_ENC_ERR_UNSUPPORTED_DEVICE

§

NV_ENC_ERR_INVALID_ENCODERDEVICE

§

NV_ENC_ERR_INVALID_DEVICE

§

NV_ENC_ERR_DEVICE_NOT_EXIST

§

NV_ENC_ERR_INVALID_PTR

§

NV_ENC_ERR_INVALID_EVENT

§

NV_ENC_ERR_INVALID_PARAM

§

NV_ENC_ERR_INVALID_CALL

§

NV_ENC_ERR_OUT_OF_MEMORY

§

NV_ENC_ERR_ENCODER_NOT_INITIALIZED

§

NV_ENC_ERR_UNSUPPORTED_PARAM

§

NV_ENC_ERR_LOCK_BUSY

§

NV_ENC_ERR_NOT_ENOUGH_BUFFER

§

NV_ENC_ERR_INVALID_VERSION

§

NV_ENC_ERR_MAP_FAILED

§

NV_ENC_ERR_NEED_MORE_INPUT

§

NV_ENC_ERR_ENCODER_BUSY

§

NV_ENC_ERR_EVENT_NOT_REGISTERD

§

NV_ENC_ERR_GENERIC

§

NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY

§

NV_ENC_ERR_UNIMPLEMENTED

§

NV_ENC_ERR_RESOURCE_REGISTER_FAILED

§

NV_ENC_ERR_RESOURCE_NOT_REGISTERED

§

NV_ENC_ERR_RESOURCE_NOT_MAPPED

§

NV_ENC_ERR_NEED_MORE_OUTPUT

Implementations§

source§

impl NVENCSTATUS

source

pub fn result(self, encoder: &Encoder) -> Result<(), EncodeError>

Convert an NVENCSTATUS to a Result.

NVENCSTATUS::NV_ENC_SUCCESS is converted to Ok(()), and all other variants are mapped to the corresponding variant in ErrorKind. The error type is EncodeError which has a kind and an optional String which might contain additional information about the error.

Errors

Returns an error whenever the status is not NVENCSTATUS::NV_ENC_SUCCESS.

Examples
let encoder = Encoder::initialize_with_cuda(cuda_device).unwrap();
// Cause an error by passing in an invalid GUID.
// `Encoder::get_supported_input_formats()` uses `.result()` internally
let error = encoder
    .get_supported_input_formats(GUID::default())
    .unwrap_err();
// Get the kind.
assert_eq!(error.kind(), ErrorKind::InvalidParam);
// Get the error message.
// Unfortunately, it's not always helpful.
assert_eq!(error.string(), Some("EncodeAPI Internal Error."));
source

pub fn result_without_string(self) -> Result<(), EncodeError>

Convert an NVENCSTATUS to a Result without using an Encoder.

This function is the same as NVENCSTATUS::result except it does not get the error string because it does not have access to an Encoder. This is only useful if you do not have an Encoder yet, for example when initializing the API.

You should always prefer to use NVENCSTATUS::result when possible.

Errors

Returns an error whenever the status is not NVENCSTATUS::NV_ENC_SUCCESS.

Trait Implementations§

source§

impl Clone for _NVENCSTATUS

source§

fn clone(&self) -> _NVENCSTATUS

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for _NVENCSTATUS

source§

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

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

impl From<_NVENCSTATUS> for ErrorKind

source§

fn from(status: NVENCSTATUS) -> Self

Converts to this type from the input type.
source§

impl Hash for _NVENCSTATUS

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for _NVENCSTATUS

source§

fn cmp(&self, other: &_NVENCSTATUS) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<_NVENCSTATUS> for _NVENCSTATUS

source§

fn eq(&self, other: &_NVENCSTATUS) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<_NVENCSTATUS> for _NVENCSTATUS

source§

fn partial_cmp(&self, other: &_NVENCSTATUS) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for _NVENCSTATUS

source§

impl Eq for _NVENCSTATUS

source§

impl StructuralEq for _NVENCSTATUS

source§

impl StructuralPartialEq for _NVENCSTATUS

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.