Enum rustc_lexer::unescape::Mode
source · pub enum Mode {
Char,
Str,
Byte,
ByteStr,
RawStr,
RawByteStr,
CStr,
RawCStr,
}
Expand description
What kind of literal do we parse.
Variants§
Implementations§
source§impl Mode
impl Mode
pub fn in_double_quotes(self) -> bool
sourcepub fn ascii_escapes_should_be_ascii(self) -> bool
pub fn ascii_escapes_should_be_ascii(self) -> bool
Non-byte literals should have \xXX
escapes that are within the ASCII range.
sourcepub fn characters_should_be_ascii(self) -> bool
pub fn characters_should_be_ascii(self) -> bool
Whether characters within the literal must be within the ASCII range
sourcepub fn is_unicode_escape_disallowed(self) -> bool
pub fn is_unicode_escape_disallowed(self) -> bool
Byte literals do not allow unicode escape.
pub fn prefix_noraw(self) -> &'static str
Trait Implementations§
source§impl PartialEq<Mode> for Mode
impl PartialEq<Mode> for Mode
impl Copy for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Char
: 0 bytesStr
: 0 bytesByte
: 0 bytesByteStr
: 0 bytesRawStr
: 0 bytesRawByteStr
: 0 bytesCStr
: 0 bytesRawCStr
: 0 bytes