pub enum FStringPart {
Literal(StringLiteral),
FString(FString),
}Expand description
An f-string part which is either a string literal or an f-string.
Variants§
Literal(StringLiteral)
FString(FString)
Implementations§
Source§impl FStringPart
impl FStringPart
Sourcepub const fn is_literal(&self) -> bool
pub const fn is_literal(&self) -> bool
Returns true if self is of variant Literal.
Sourcepub fn as_literal(&self) -> Option<&StringLiteral>
pub fn as_literal(&self) -> Option<&StringLiteral>
Returns Some if self is a reference of variant Literal, and None otherwise.
Sourcepub fn as_mut_literal(&mut self) -> Option<&mut StringLiteral>
pub fn as_mut_literal(&mut self) -> Option<&mut StringLiteral>
Returns Some if self is a mutable reference of variant Literal, and None otherwise.
Sourcepub fn expect_literal(self) -> StringLiteralwhere
Self: Debug,
pub fn expect_literal(self) -> StringLiteralwhere
Self: Debug,
Sourcepub fn literal(self) -> Option<StringLiteral>
pub fn literal(self) -> Option<StringLiteral>
Returns Some if self is of variant Literal, and None otherwise.
Sourcepub const fn is_f_string(&self) -> bool
pub const fn is_f_string(&self) -> bool
Returns true if self is of variant FString.
Sourcepub fn as_f_string(&self) -> Option<&FString>
pub fn as_f_string(&self) -> Option<&FString>
Returns Some if self is a reference of variant FString, and None otherwise.
Sourcepub fn as_mut_f_string(&mut self) -> Option<&mut FString>
pub fn as_mut_f_string(&mut self) -> Option<&mut FString>
Returns Some if self is a mutable reference of variant FString, and None otherwise.
Sourcepub fn expect_f_string(self) -> FStringwhere
Self: Debug,
pub fn expect_f_string(self) -> FStringwhere
Self: Debug,
Source§impl FStringPart
impl FStringPart
pub fn quote_style(&self) -> Quote
pub fn is_empty_literal(&self) -> bool
Trait Implementations§
Source§impl Clone for FStringPart
impl Clone for FStringPart
Source§fn clone(&self) -> FStringPart
fn clone(&self) -> FStringPart
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FStringPart
impl Debug for FStringPart
Source§impl PartialEq for FStringPart
impl PartialEq for FStringPart
Source§impl Ranged for FStringPart
impl Ranged for FStringPart
impl StructuralPartialEq for FStringPart
Auto Trait Implementations§
impl !Freeze for FStringPart
impl RefUnwindSafe for FStringPart
impl Send for FStringPart
impl Sync for FStringPart
impl Unpin for FStringPart
impl UnsafeUnpin for FStringPart
impl UnwindSafe for FStringPart
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more