pub enum StringLikePart<'a> {
String(&'a StringLiteral),
Bytes(&'a BytesLiteral),
FString(&'a FString),
TString(&'a TString),
}Expand description
An enum that holds a reference to an individual part of a string-like expression.
Variants§
Implementations§
Source§impl<'a> StringLikePart<'a>
impl<'a> StringLikePart<'a>
Sourcepub fn flags(&self) -> AnyStringFlags
pub fn flags(&self) -> AnyStringFlags
Returns the AnyStringFlags for the current string-like part.
Sourcepub fn content_range(self) -> TextRange
pub fn content_range(self) -> TextRange
Returns the range of the string’s content in the source (minus prefix and quotes).
pub const fn is_string_literal(self) -> bool
pub const fn as_string_literal(self) -> Option<&'a StringLiteral>
pub const fn is_interpolated_string(self) -> bool
Trait Implementations§
Source§impl<'a> Clone for StringLikePart<'a>
impl<'a> Clone for StringLikePart<'a>
Source§fn clone(&self) -> StringLikePart<'a>
fn clone(&self) -> StringLikePart<'a>
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<'a> Debug for StringLikePart<'a>
impl<'a> Debug for StringLikePart<'a>
Source§impl<'a> From<&'a BytesLiteral> for StringLikePart<'a>
impl<'a> From<&'a BytesLiteral> for StringLikePart<'a>
Source§fn from(value: &'a BytesLiteral) -> StringLikePart<'a>
fn from(value: &'a BytesLiteral) -> StringLikePart<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a FString> for StringLikePart<'a>
impl<'a> From<&'a FString> for StringLikePart<'a>
Source§fn from(value: &'a FString) -> StringLikePart<'a>
fn from(value: &'a FString) -> StringLikePart<'a>
Converts to this type from the input type.
Source§impl<'a> From<&StringLikePart<'a>> for AnyNodeRef<'a>
impl<'a> From<&StringLikePart<'a>> for AnyNodeRef<'a>
Source§fn from(value: &StringLikePart<'a>) -> AnyNodeRef<'a>
fn from(value: &StringLikePart<'a>) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a StringLiteral> for StringLikePart<'a>
impl<'a> From<&'a StringLiteral> for StringLikePart<'a>
Source§fn from(value: &'a StringLiteral) -> StringLikePart<'a>
fn from(value: &'a StringLiteral) -> StringLikePart<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a TString> for StringLikePart<'a>
impl<'a> From<&'a TString> for StringLikePart<'a>
Source§fn from(value: &'a TString) -> StringLikePart<'a>
fn from(value: &'a TString) -> StringLikePart<'a>
Converts to this type from the input type.
Source§impl<'a> From<StringLikePart<'a>> for AnyNodeRef<'a>
impl<'a> From<StringLikePart<'a>> for AnyNodeRef<'a>
Source§fn from(value: StringLikePart<'a>) -> AnyNodeRef<'a>
fn from(value: StringLikePart<'a>) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl<'a> PartialEq for StringLikePart<'a>
impl<'a> PartialEq for StringLikePart<'a>
Source§impl Ranged for StringLikePart<'_>
impl Ranged for StringLikePart<'_>
impl<'a> Copy for StringLikePart<'a>
impl<'a> StructuralPartialEq for StringLikePart<'a>
Auto Trait Implementations§
impl<'a> Freeze for StringLikePart<'a>
impl<'a> RefUnwindSafe for StringLikePart<'a>
impl<'a> Send for StringLikePart<'a>
impl<'a> Sync for StringLikePart<'a>
impl<'a> Unpin for StringLikePart<'a>
impl<'a> UnsafeUnpin for StringLikePart<'a>
impl<'a> UnwindSafe for StringLikePart<'a>
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