pub enum Encoding {
Plain,
Wide,
Utf8,
Utf16,
Utf32,
}Expand description
The encoding prefix of a character constant or a string literal.
Variants§
Plain
No prefix, whose element is a char.
Wide
L, whose element is a wchar_t and so is a fact about the target.
Utf8
u8, whose element is a char8_t, which is an unsigned char.
Utf16
u, whose element is a char16_t, which is a uint_least16_t.
Utf32
U, whose element is a char32_t, which is a uint_least32_t.
Implementations§
Source§impl Encoding
impl Encoding
Sourcepub fn element_width(self, target: &TargetInfo) -> u32
pub fn element_width(self, target: &TargetInfo) -> u32
The width of one element in bits.
Sourcepub fn is_signed(self, target: &TargetInfo) -> bool
pub fn is_signed(self, target: &TargetInfo) -> bool
Whether the element type is signed, which only char and wchar_t can be.
Sourcepub const fn prefix(self) -> &'static str
pub const fn prefix(self) -> &'static str
The prefix this encoding is written with, which is empty for a plain literal.
Sourcepub fn read_prefix(text: &str) -> Encoding
pub fn read_prefix(text: &str) -> Encoding
The prefix a spelling was written with, for a caller that needs the encoding of a literal it could not convert.
Trait Implementations§
impl Copy for Encoding
impl Eq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnsafeUnpin for Encoding
impl UnwindSafe for Encoding
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