pub struct ByteLiteral;Expand description
An abstraction over a byte literal to provide a method to convert safely
to a c_char.
The abstraction is required so we can contain architecture specific code in a central location.
Implementations§
Source§impl ByteLiteral
impl ByteLiteral
Sourcepub fn cast_cchar(input: u8) -> c_char
pub fn cast_cchar(input: u8) -> c_char
Casts a byte literal (u8) to a c_char without using as.
§Panics
If input is not within the following range of ascii characters:
- Octal:
040..=176 - Decimal:
30..=126 - Hexadecimal:
20..=7E - Byte literals: The space character (
) upto and including tilde (~)
Auto Trait Implementations§
impl Freeze for ByteLiteral
impl RefUnwindSafe for ByteLiteral
impl Send for ByteLiteral
impl Sync for ByteLiteral
impl Unpin for ByteLiteral
impl UnsafeUnpin for ByteLiteral
impl UnwindSafe for ByteLiteral
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