pub enum InterpolatedStringElementRef<'a> {
Interpolation(&'a InterpolatedElement),
Literal(&'a InterpolatedStringLiteralElement),
}Variants§
Interpolation(&'a InterpolatedElement)
Literal(&'a InterpolatedStringLiteralElement)
Implementations§
Source§impl<'a> InterpolatedStringElementRef<'a>
impl<'a> InterpolatedStringElementRef<'a>
Sourcepub const fn is_interpolation(&self) -> bool
pub const fn is_interpolation(&self) -> bool
Returns true if self is of variant Interpolation.
Sourcepub fn as_interpolation(&self) -> Option<&&'a InterpolatedElement>
pub fn as_interpolation(&self) -> Option<&&'a InterpolatedElement>
Returns Some if self is a reference of variant Interpolation, and None otherwise.
Sourcepub fn as_mut_interpolation(&mut self) -> Option<&mut &'a InterpolatedElement>
pub fn as_mut_interpolation(&mut self) -> Option<&mut &'a InterpolatedElement>
Returns Some if self is a mutable reference of variant Interpolation, and None otherwise.
Sourcepub fn expect_interpolation(self) -> &'a InterpolatedElementwhere
Self: Debug,
pub fn expect_interpolation(self) -> &'a InterpolatedElementwhere
Self: Debug,
Unwraps the value, yielding the content of Interpolation.
§Panics
Panics if the value is not Interpolation, with a panic message including the content of self.
Sourcepub fn interpolation(self) -> Option<&'a InterpolatedElement>
pub fn interpolation(self) -> Option<&'a InterpolatedElement>
Returns Some if self is of variant Interpolation, and None otherwise.
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<&&'a InterpolatedStringLiteralElement>
pub fn as_literal(&self) -> Option<&&'a InterpolatedStringLiteralElement>
Returns Some if self is a reference of variant Literal, and None otherwise.
Sourcepub fn as_mut_literal(
&mut self,
) -> Option<&mut &'a InterpolatedStringLiteralElement>
pub fn as_mut_literal( &mut self, ) -> Option<&mut &'a InterpolatedStringLiteralElement>
Returns Some if self is a mutable reference of variant Literal, and None otherwise.
Sourcepub fn expect_literal(self) -> &'a InterpolatedStringLiteralElementwhere
Self: Debug,
pub fn expect_literal(self) -> &'a InterpolatedStringLiteralElementwhere
Self: Debug,
Sourcepub fn literal(self) -> Option<&'a InterpolatedStringLiteralElement>
pub fn literal(self) -> Option<&'a InterpolatedStringLiteralElement>
Returns Some if self is of variant Literal, and None otherwise.
Trait Implementations§
Source§impl<'a> Clone for InterpolatedStringElementRef<'a>
impl<'a> Clone for InterpolatedStringElementRef<'a>
Source§fn clone(&self) -> InterpolatedStringElementRef<'a>
fn clone(&self) -> InterpolatedStringElementRef<'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 InterpolatedStringElementRef<'a>
impl<'a> Debug for InterpolatedStringElementRef<'a>
Source§impl<'a> From<&'a InterpolatedElement> for InterpolatedStringElementRef<'a>
impl<'a> From<&'a InterpolatedElement> for InterpolatedStringElementRef<'a>
Source§fn from(node: &'a InterpolatedElement) -> Self
fn from(node: &'a InterpolatedElement) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a InterpolatedStringElement> for InterpolatedStringElementRef<'a>
impl<'a> From<&'a InterpolatedStringElement> for InterpolatedStringElementRef<'a>
Source§fn from(node: &'a InterpolatedStringElement) -> Self
fn from(node: &'a InterpolatedStringElement) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a InterpolatedStringLiteralElement> for InterpolatedStringElementRef<'a>
impl<'a> From<&'a InterpolatedStringLiteralElement> for InterpolatedStringElementRef<'a>
Source§fn from(node: &'a InterpolatedStringLiteralElement) -> Self
fn from(node: &'a InterpolatedStringLiteralElement) -> Self
Converts to this type from the input type.
Source§impl<'a> From<InterpolatedStringElementRef<'a>> for AnyNodeRef<'a>
impl<'a> From<InterpolatedStringElementRef<'a>> for AnyNodeRef<'a>
Source§fn from(node: InterpolatedStringElementRef<'a>) -> AnyNodeRef<'a>
fn from(node: InterpolatedStringElementRef<'a>) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl HasNodeIndex for InterpolatedStringElementRef<'_>
impl HasNodeIndex for InterpolatedStringElementRef<'_>
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
Returns the
AtomicNodeIndex for this node.Source§impl<'a> PartialEq for InterpolatedStringElementRef<'a>
impl<'a> PartialEq for InterpolatedStringElementRef<'a>
Source§fn eq(&self, other: &InterpolatedStringElementRef<'a>) -> bool
fn eq(&self, other: &InterpolatedStringElementRef<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Ranged for InterpolatedStringElementRef<'_>
impl Ranged for InterpolatedStringElementRef<'_>
impl<'a> Copy for InterpolatedStringElementRef<'a>
impl<'a> StructuralPartialEq for InterpolatedStringElementRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for InterpolatedStringElementRef<'a>
impl<'a> RefUnwindSafe for InterpolatedStringElementRef<'a>
impl<'a> Send for InterpolatedStringElementRef<'a>
impl<'a> Sync for InterpolatedStringElementRef<'a>
impl<'a> Unpin for InterpolatedStringElementRef<'a>
impl<'a> UnsafeUnpin for InterpolatedStringElementRef<'a>
impl<'a> UnwindSafe for InterpolatedStringElementRef<'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