Enum swc_ecma_ast::OptChainBase
source · [−]pub enum OptChainBase {
Member(MemberExpr),
Call(OptCall),
}
Variants
Member(MemberExpr)
Call(OptCall)
Implementations
sourceimpl 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
Self: Debug,
pub fn expect_member(self) -> MemberExprwhere
Self: 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
Self: Debug,
pub fn expect_call(self) -> OptCallwhere
Self: Debug,
Trait Implementations
sourceimpl Clone for OptChainBase
impl Clone for OptChainBase
sourcefn clone(&self) -> OptChainBase
fn clone(&self) -> OptChainBase
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for OptChainBase
impl Debug for OptChainBase
sourceimpl<'de> Deserialize<'de> for OptChainBase
impl<'de> Deserialize<'de> for OptChainBase
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for OptChainBase
impl EqIgnoreSpan for OptChainBase
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<MemberExpr> for OptChainBase
impl From<MemberExpr> for OptChainBase
sourcefn from(v: MemberExpr) -> Self
fn from(v: MemberExpr) -> Self
Converts to this type from the input type.
sourceimpl From<OptCall> for OptChainBase
impl From<OptCall> for OptChainBase
sourceimpl From<OptChainBase> for Expr
impl From<OptChainBase> for Expr
sourcefn from(opt: OptChainBase) -> Self
fn from(opt: OptChainBase) -> Self
Converts to this type from the input type.
sourceimpl Hash for OptChainBase
impl Hash for OptChainBase
sourceimpl PartialEq<OptChainBase> for OptChainBase
impl PartialEq<OptChainBase> for OptChainBase
sourcefn eq(&self, other: &OptChainBase) -> bool
fn eq(&self, other: &OptChainBase) -> bool
sourceimpl Serialize for OptChainBase
impl Serialize for OptChainBase
sourceimpl Spanned for OptChainBase
impl Spanned for OptChainBase
sourceimpl Take for OptChainBase
impl Take for OptChainBase
impl Eq for OptChainBase
impl StructuralEq for OptChainBase
impl StructuralPartialEq for OptChainBase
Auto Trait Implementations
impl RefUnwindSafe for OptChainBase
impl Send for OptChainBase
impl Sync for OptChainBase
impl Unpin for OptChainBase
impl UnwindSafe for OptChainBase
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more