Struct litrs::StringLit [−][src]
pub struct StringLit<B: Buffer> { /* fields omitted */ }
Expand description
A string or raw string literal, e.g. "foo"
, "Grüße"
or r#"a🦊c"d🦀f"#
.
See the reference for more information.
Implementations
Parses the input as a (raw) string literal. Returns an error if the input is invalid or represents a different kind of literal.
Returns the string value this literal represents (where all escapes have been turned into their respective values).
Like value
but returns a potentially owned version of the value.
The return value is either Cow<'static, str>
if B = String
, or
Cow<'a, str>
if B = &'a str
.
Returns whether this literal is a raw string literal (starting with
r
).
Makes a copy of the underlying buffer and returns the owned version of
Self
.
Trait Implementations
Auto Trait Implementations
impl<B> RefUnwindSafe for StringLit<B> where
B: RefUnwindSafe,
impl<B> UnwindSafe for StringLit<B> where
B: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more