pub struct ByteLit<B: Buffer> {
raw: B,
start_suffix: usize,
value: u8,
}
Expand description
A (single) byte literal, e.g. b'k'
or b'!'
.
See the reference for more information.
Fields§
§raw: B
§start_suffix: usize
Start index of the suffix or raw.len()
if there is no suffix.
value: u8
Implementations§
source§impl<B: Buffer> ByteLit<B>
impl<B: Buffer> ByteLit<B>
sourcepub fn parse(input: B) -> Result<Self, ParseError>
pub fn parse(input: B) -> Result<Self, ParseError>
Parses the input as a byte literal. Returns an error if the input is invalid or represents a different kind of literal.
sourcepub fn suffix(&self) -> &str
pub fn suffix(&self) -> &str
The optional suffix. Returns ""
if the suffix is empty/does not exist.
sourcepub fn into_raw_input(self) -> B
pub fn into_raw_input(self) -> B
Returns the raw input that was passed to parse
, potentially owned.
Trait Implementations§
impl<B: Copy + Buffer> Copy for ByteLit<B>
impl<B: Eq + Buffer> Eq for ByteLit<B>
impl<B: Buffer> StructuralPartialEq for ByteLit<B>
Auto Trait Implementations§
impl<B> Freeze for ByteLit<B>where
B: Freeze,
impl<B> RefUnwindSafe for ByteLit<B>where
B: RefUnwindSafe,
impl<B> Send for ByteLit<B>where
B: Send,
impl<B> Sync for ByteLit<B>where
B: Sync,
impl<B> Unpin for ByteLit<B>where
B: Unpin,
impl<B> UnwindSafe for ByteLit<B>where
B: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)