Struct four_char_code::FourCharCode
source · #[repr(transparent)]pub struct FourCharCode(_);
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.
Trait Implementations§
source§impl Clone for FourCharCode
impl Clone for FourCharCode
source§fn clone(&self) -> FourCharCode
fn clone(&self) -> FourCharCode
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 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<[u8; 4]> for FourCharCode
impl PartialEq<[u8; 4]> for FourCharCode
source§impl PartialEq<FourCharCode> for FourCharCode
impl PartialEq<FourCharCode> for FourCharCode
source§fn eq(&self, other: &FourCharCode) -> bool
fn eq(&self, other: &FourCharCode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<str> for FourCharCode
impl PartialEq<str> for FourCharCode
source§impl PartialEq<u32> for FourCharCode
impl PartialEq<u32> for FourCharCode
source§impl PartialOrd<&[u8]> for FourCharCode
impl PartialOrd<&[u8]> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<&str> for FourCharCode
impl PartialOrd<&str> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<[u8]> for FourCharCode
impl PartialOrd<[u8]> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<[u8; 4]> for FourCharCode
impl PartialOrd<[u8; 4]> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<FourCharCode> for FourCharCode
impl PartialOrd<FourCharCode> for FourCharCode
source§fn partial_cmp(&self, other: &FourCharCode) -> Option<Ordering>
fn partial_cmp(&self, other: &FourCharCode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<str> for FourCharCode
impl PartialOrd<str> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PartialOrd<u32> for FourCharCode
impl PartialOrd<u32> for FourCharCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl ToString for FourCharCode
impl ToString for FourCharCode
impl Copy for FourCharCode
impl Eq for FourCharCode
impl StructuralEq for FourCharCode
impl StructuralPartialEq for FourCharCode
Auto Trait Implementations§
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