pub enum OptChainBase {
Member(MemberExpr),
Call(OptCall),
}Variants§
Member(MemberExpr)
Call(OptCall)
Implementations§
Source§impl OptChainBase
impl OptChainBase
Sourcepub fn as_member(&self) -> Option<&MemberExpr>
pub fn as_member(&self) -> Option<&MemberExpr>
Returns Some if self is a reference of variant Member, and None otherwise.
Sourcepub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
pub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
Returns Some if self is a mutable reference of variant Member, and None otherwise.
Sourcepub fn expect_member(self) -> MemberExprwhere
OptChainBase: Debug,
pub fn expect_member(self) -> MemberExprwhere
OptChainBase: Debug,
Sourcepub fn member(self) -> Option<MemberExpr>
pub fn member(self) -> Option<MemberExpr>
Returns Some if self is of variant Member, and None otherwise.
Sourcepub fn as_call(&self) -> Option<&OptCall>
pub fn as_call(&self) -> Option<&OptCall>
Returns Some if self is a reference of variant Call, and None otherwise.
Sourcepub fn as_mut_call(&mut self) -> Option<&mut OptCall>
pub fn as_mut_call(&mut self) -> Option<&mut OptCall>
Returns Some if self is a mutable reference of variant Call, and None otherwise.
Sourcepub fn expect_call(self) -> OptCallwhere
OptChainBase: Debug,
pub fn expect_call(self) -> OptCallwhere
OptChainBase: Debug,
Trait Implementations§
Source§impl Clone for OptChainBase
impl Clone for OptChainBase
Source§fn clone(&self) -> OptChainBase
fn clone(&self) -> OptChainBase
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 OptChainBase
impl Debug for OptChainBase
Source§impl Default for OptChainBase
impl Default for OptChainBase
Source§fn default() -> OptChainBase
fn default() -> OptChainBase
Returns the “default value” for a type. Read more
Source§impl EqIgnoreSpan for OptChainBase
impl EqIgnoreSpan for OptChainBase
fn eq_ignore_span(&self, other: &OptChainBase) -> bool
Source§impl<V> FoldWith<V> for OptChainBase
impl<V> FoldWith<V> for OptChainBase
Source§fn fold_with(self, visitor: &mut V) -> OptChainBase
fn fold_with(self, visitor: &mut V) -> OptChainBase
Calls Fold::fold_opt_chain_base with self.
Source§fn fold_children_with(self, visitor: &mut V) -> OptChainBase
fn fold_children_with(self, visitor: &mut V) -> OptChainBase
Visit children nodes of
self`` with visitor`.Source§impl From<MemberExpr> for OptChainBase
impl From<MemberExpr> for OptChainBase
Source§fn from(v: MemberExpr) -> OptChainBase
fn from(v: MemberExpr) -> OptChainBase
Converts to this type from the input type.
Source§impl From<OptCall> for OptChainBase
impl From<OptCall> for OptChainBase
Source§fn from(v: OptCall) -> OptChainBase
fn from(v: OptCall) -> OptChainBase
Converts to this type from the input type.
Source§impl From<OptChainBase> for Expr
impl From<OptChainBase> for Expr
Source§fn from(opt: OptChainBase) -> Expr
fn from(opt: OptChainBase) -> Expr
Converts to this type from the input type.
Source§impl Hash for OptChainBase
impl Hash for OptChainBase
Source§impl PartialEq for OptChainBase
impl PartialEq for OptChainBase
Source§impl Spanned for OptChainBase
impl Spanned for OptChainBase
Source§impl<V> VisitMutWith<V> for OptChainBase
impl<V> VisitMutWith<V> for OptChainBase
Source§fn visit_mut_with(&mut self, visitor: &mut V)
fn visit_mut_with(&mut self, visitor: &mut V)
Calls VisitMut::visit_mut_opt_chain_base with self.
Source§fn visit_mut_children_with(&mut self, visitor: &mut V)
fn visit_mut_children_with(&mut self, visitor: &mut V)
Visit children nodes of
self`` with visitor`.Source§impl<V> VisitWith<V> for OptChainBase
impl<V> VisitWith<V> for OptChainBase
Source§fn visit_with(&self, visitor: &mut V)
fn visit_with(&self, visitor: &mut V)
Calls Visit::visit_opt_chain_base with self.
Source§fn visit_children_with(&self, visitor: &mut V)
fn visit_children_with(&self, visitor: &mut V)
Visit children nodes of
self`` with visitor`.impl Eq for OptChainBase
impl StructuralPartialEq for OptChainBase
Auto Trait Implementations§
impl Freeze for OptChainBase
impl RefUnwindSafe for OptChainBase
impl Send for OptChainBase
impl Sync for OptChainBase
impl Unpin for OptChainBase
impl UnwindSafe for OptChainBase
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> ImplicitClone for Twhere
T: Clone,
impl<T> ImplicitClone for Twhere
T: Clone,
fn clone_quote_var(&self) -> Self
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> SpanExt for Twhere
T: Spanned,
impl<T> SpanExt for Twhere
T: Spanned,
fn is_synthesized(&self) -> bool
fn starts_on_new_line(&self, format: ListFormat) -> bool
Source§fn comment_range(&self) -> Span
fn comment_range(&self) -> Span
Gets a custom text range to use when emitting comments.