pub struct PackedChar(/* private fields */);Expand description
Stores either a char or a U22 in 32 bits of space.
Implementations§
Source§impl PackedChar
impl PackedChar
Sourcepub const fn from_char(c: char) -> Self
pub const fn from_char(c: char) -> Self
Creates a new value from the given char.
§Examples
let pack = PackedChar::from_char('a');
assert_eq!(pack.contents(), Contents::Char('a'));Trait Implementations§
Source§impl Clone for PackedChar
impl Clone for PackedChar
Source§fn clone(&self) -> PackedChar
fn clone(&self) -> PackedChar
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 PackedChar
impl Debug for PackedChar
Source§impl Default for PackedChar
impl Default for PackedChar
Source§fn default() -> PackedChar
fn default() -> PackedChar
Returns the “default value” for a type. Read more
Source§impl From<U22> for PackedChar
impl From<U22> for PackedChar
Source§impl From<char> for PackedChar
impl From<char> for PackedChar
Source§impl Hash for PackedChar
impl Hash for PackedChar
Source§impl Ord for PackedChar
impl Ord for PackedChar
Source§fn cmp(&self, other: &PackedChar) -> Ordering
fn cmp(&self, other: &PackedChar) -> 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 for PackedChar
impl PartialEq for PackedChar
Source§impl PartialOrd for PackedChar
impl PartialOrd for PackedChar
Source§impl TryFrom<u32> for PackedChar
impl TryFrom<u32> for PackedChar
impl Copy for PackedChar
impl Eq for PackedChar
impl StructuralPartialEq for PackedChar
Auto Trait Implementations§
impl Freeze for PackedChar
impl RefUnwindSafe for PackedChar
impl Send for PackedChar
impl Sync for PackedChar
impl Unpin for PackedChar
impl UnwindSafe for PackedChar
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