pub struct FourCharCode(/* private fields */);
Expand description
The main structure, actually a u32.
Implementations§
Source§impl FourCharCode
impl FourCharCode
Sourcepub const fn new(value: u32) -> Result<Self, FccConversionError>
pub const fn new(value: u32) -> Result<Self, FccConversionError>
Returns a FourCharCode if value is valid, an error describing the problem otherwise.
Sourcepub const unsafe fn new_unchecked(value: u32) -> Self
pub const unsafe fn new_unchecked(value: u32) -> Self
Returns a FourCharCode containing the given value.
§Safety
Passing an invalid value can cause a panic
Sourcepub const fn from_array(value: [u8; 4]) -> Result<Self, FccConversionError>
pub const fn from_array(value: [u8; 4]) -> Result<Self, FccConversionError>
Returns a FourCharCode if values are valid, an error describing the problem otherwise.
Sourcepub const fn from_slice(value: &[u8]) -> Result<Self, FccConversionError>
pub const fn from_slice(value: &[u8]) -> Result<Self, FccConversionError>
Returns a FourCharCode if slice is valid, an error describing the problem otherwise.
Sourcepub const fn from_str(value: &str) -> Result<Self, FccConversionError>
pub const fn from_str(value: &str) -> Result<Self, FccConversionError>
Returns a FourCharCode if string is valid, an error describing the problem otherwise.
Sourcepub fn display(&self) -> Display
pub fn display(&self) -> Display
Returns an object that implements core::fmt::Display for safely printing fourcc’s that may contain non-ASCII characters.
Sourcepub const fn as_u32(&self) -> u32
pub const fn as_u32(&self) -> u32
Returns the underlying u32
this FourCharCode represents
Trait Implementations§
Source§impl Clone for FourCharCode
impl Clone for FourCharCode
Source§fn clone(&self) -> FourCharCode
fn clone(&self) -> FourCharCode
Returns a duplicate 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 FourCharCode
impl Debug for FourCharCode
Source§impl Default for FourCharCode
impl Default for FourCharCode
Source§impl From<FourCharCode> for String
impl From<FourCharCode> for String
Source§fn from(value: FourCharCode) -> Self
fn from(value: FourCharCode) -> Self
Converts to this type from the input type.
Source§impl From<FourCharCode> for u32
impl From<FourCharCode> for u32
Source§fn from(value: FourCharCode) -> Self
fn from(value: FourCharCode) -> Self
Converts to this type from the input type.
Source§impl Hash for FourCharCode
impl Hash for FourCharCode
Source§impl Ord for FourCharCode
impl Ord for FourCharCode
Source§fn cmp(&self, other: &FourCharCode) -> Ordering
fn cmp(&self, other: &FourCharCode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<&[u8]> for FourCharCode
impl PartialEq<&[u8]> for FourCharCode
Source§impl PartialEq<&str> for FourCharCode
impl PartialEq<&str> for FourCharCode
Source§impl PartialEq<[u8]> for FourCharCode
impl PartialEq<[u8]> for FourCharCode
Source§impl PartialEq<str> for FourCharCode
impl PartialEq<str> for FourCharCode
Source§impl PartialEq<u32> for FourCharCode
impl PartialEq<u32> for FourCharCode
Source§impl PartialEq for FourCharCode
impl PartialEq for FourCharCode
Source§impl PartialOrd<&[u8]> for FourCharCode
impl PartialOrd<&[u8]> for FourCharCode
Source§impl PartialOrd<&str> for FourCharCode
impl PartialOrd<&str> for FourCharCode
Source§impl PartialOrd<[u8]> for FourCharCode
impl PartialOrd<[u8]> for FourCharCode
Source§impl PartialOrd<[u8; 4]> for FourCharCode
impl PartialOrd<[u8; 4]> for FourCharCode
Source§impl PartialOrd<str> for FourCharCode
impl PartialOrd<str> for FourCharCode
Source§impl PartialOrd<u32> for FourCharCode
impl PartialOrd<u32> for FourCharCode
Source§impl PartialOrd for FourCharCode
impl PartialOrd for FourCharCode
Source§impl ToString for FourCharCode
impl ToString for FourCharCode
impl Copy for FourCharCode
impl Eq for FourCharCode
impl StructuralPartialEq for FourCharCode
Auto Trait Implementations§
impl Freeze for FourCharCode
impl RefUnwindSafe for FourCharCode
impl Send for FourCharCode
impl Sync for FourCharCode
impl Unpin for FourCharCode
impl UnwindSafe for FourCharCode
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