pub struct UnrecognizedFourcc(pub u32);
Expand description
Wraps some u32 that isn’t a DRM fourcc we recognize
// Get the u32
assert_eq!(UnrecognizedFourcc(42).0, 42);
// Get the string form
assert_eq!(UnrecognizedFourcc(828601953).string_form(), Some("avc1".to_string()));
assert_eq!(UnrecognizedFourcc(0).string_form(), None);
Tuple Fields§
§0: u32
Implementations§
Source§impl UnrecognizedFourcc
impl UnrecognizedFourcc
Sourcepub fn string_form(&self) -> Option<String>
pub fn string_form(&self) -> Option<String>
If the u32 is in a valid format to be a fourcc, get its string form.
Note that this requires the std
feature to be enabled. The [display
] method is an
alternative that does not require this dependency.
Sourcepub fn display(&self) -> Option<impl Display>
pub fn display(&self) -> Option<impl Display>
If the u32 is in a valid format to be a fourcc, get an opaque type to display it.
This can be treated as a slightly generalized form of [string_form
] that is also
available when the crate does not depend on the standard or alloc
crate.
assert!(UnrecognizedFourcc(828601953).display().is_some());
assert!(UnrecognizedFourcc(0).display().is_none());
Trait Implementations§
Source§impl Clone for UnrecognizedFourcc
impl Clone for UnrecognizedFourcc
Source§fn clone(&self) -> UnrecognizedFourcc
fn clone(&self) -> UnrecognizedFourcc
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UnrecognizedFourcc
impl Debug for UnrecognizedFourcc
Source§impl Display for UnrecognizedFourcc
impl Display for UnrecognizedFourcc
Source§impl Error for UnrecognizedFourcc
impl Error for UnrecognizedFourcc
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for UnrecognizedFourcc
impl PartialEq for UnrecognizedFourcc
impl Copy for UnrecognizedFourcc
impl Eq for UnrecognizedFourcc
impl StructuralPartialEq for UnrecognizedFourcc
Auto Trait Implementations§
impl Freeze for UnrecognizedFourcc
impl RefUnwindSafe for UnrecognizedFourcc
impl Send for UnrecognizedFourcc
impl Sync for UnrecognizedFourcc
impl Unpin for UnrecognizedFourcc
impl UnwindSafe for UnrecognizedFourcc
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