Struct syn::LitByteStr
source · pub struct LitByteStr { /* private fields */ }
Expand description
A byte string literal: b"foo"
.
Implementations§
source§impl LitByteStr
impl LitByteStr
pub fn new(value: &[u8], span: Span) -> Self
pub fn value(&self) -> Vec<u8>
sourcepub fn span(&self) -> Span
pub fn span(&self) -> Span
Examples found in repository?
More examples
src/lit.rs (line 1038)
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 1051)
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 Clone for LitByteStr
Available on crate feature clone-impls
only.
impl Clone for LitByteStr
Available on crate feature
clone-impls
only.source§impl Debug for LitByteStr
Available on crate feature extra-traits
only.
impl Debug for LitByteStr
Available on crate feature
extra-traits
only.source§impl From<LitByteStr> for Lit
impl From<LitByteStr> for Lit
source§fn from(e: LitByteStr) -> Lit
fn from(e: LitByteStr) -> Lit
Converts to this type from the input type.
source§impl Hash for LitByteStr
Available on crate feature extra-traits
only.
impl Hash for LitByteStr
Available on crate feature
extra-traits
only.source§impl Parse for LitByteStr
Available on crate feature parsing
only.
impl Parse for LitByteStr
Available on crate feature
parsing
only.fn parse(input: ParseStream<'_>) -> Result<Self>
source§impl PartialEq<LitByteStr> for LitByteStr
Available on crate feature extra-traits
only.
impl PartialEq<LitByteStr> for LitByteStr
Available on crate feature
extra-traits
only.source§impl ToTokens for LitByteStr
Available on crate feature printing
only.
impl ToTokens for LitByteStr
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 LitByteStr
Available on crate feature
extra-traits
only.