pub struct CharLit<B: Buffer> {
raw: B,
start_suffix: usize,
value: char,
}
Expand description
A character literal, e.g. 'g'
or '๐ฆ'
.
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: char
Implementationsยง
sourceยงimpl<B: Buffer> CharLit<B>
impl<B: Buffer> CharLit<B>
sourcepub fn parse(input: B) -> Result<Self, ParseError>
pub fn parse(input: B) -> Result<Self, ParseError>
Parses the input as a character 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 CharLit<B>
impl<B: Eq + Buffer> Eq for CharLit<B>
impl<B: Buffer> StructuralPartialEq for CharLit<B>
Auto Trait Implementationsยง
impl<B> Freeze for CharLit<B>where
B: Freeze,
impl<B> RefUnwindSafe for CharLit<B>where
B: RefUnwindSafe,
impl<B> Send for CharLit<B>where
B: Send,
impl<B> Sync for CharLit<B>where
B: Sync,
impl<B> Unpin for CharLit<B>where
B: Unpin,
impl<B> UnwindSafe for CharLit<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
)