pub struct LitByte { /* private fields */ }
Expand description
A byte literal: b'f'
.
Implementations§
source§impl LitByte
impl LitByte
pub fn new(value: u8, span: Span) -> Self
pub fn value(&self) -> u8
sourcepub fn span(&self) -> Span
pub fn span(&self) -> Span
Examples found in repository?
More examples
src/lit.rs (line 1039)
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
pub fn span(&self) -> Span {
match self {
Lit::Str(lit) => lit.span(),
Lit::ByteStr(lit) => lit.span(),
Lit::Byte(lit) => lit.span(),
Lit::Char(lit) => lit.span(),
Lit::Int(lit) => lit.span(),
Lit::Float(lit) => lit.span(),
Lit::Bool(lit) => lit.span,
Lit::Verbatim(lit) => lit.span(),
}
}
sourcepub fn set_span(&mut self, span: Span)
pub fn set_span(&mut self, span: Span)
Examples found in repository?
More examples
src/lit.rs (line 1052)
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059
pub fn set_span(&mut self, span: Span) {
match self {
Lit::Str(lit) => lit.set_span(span),
Lit::ByteStr(lit) => lit.set_span(span),
Lit::Byte(lit) => lit.set_span(span),
Lit::Char(lit) => lit.set_span(span),
Lit::Int(lit) => lit.set_span(span),
Lit::Float(lit) => lit.set_span(span),
Lit::Bool(lit) => lit.span = span,
Lit::Verbatim(lit) => lit.set_span(span),
}
}
pub fn token(&self) -> Literal
Trait Implementations§
source§impl Parse for LitByte
Available on crate feature parsing
only.
impl Parse for LitByte
Available on crate feature
parsing
only.fn parse(input: ParseStream<'_>) -> Result<Self>
source§impl PartialEq<LitByte> for LitByte
Available on crate feature extra-traits
only.
impl PartialEq<LitByte> for LitByte
Available on crate feature
extra-traits
only.source§impl ToTokens for LitByte
Available on crate feature printing
only.
impl ToTokens for LitByte
Available on crate feature
printing
only.source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for LitByte
Available on crate feature
extra-traits
only.