Enum swc_ecma_ast::TsFnParam
source · [−]pub enum TsFnParam {
Ident(BindingIdent),
Array(ArrayPat),
Rest(RestPat),
Object(ObjectPat),
}
Variants
Ident(BindingIdent)
Array(ArrayPat)
Rest(RestPat)
Object(ObjectPat)
Implementations
sourceimpl TsFnParam
impl TsFnParam
sourcepub fn as_ident(&self) -> Option<&BindingIdent>
pub fn as_ident(&self) -> Option<&BindingIdent>
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
sourcepub fn as_mut_ident(&mut self) -> Option<&mut BindingIdent>
pub fn as_mut_ident(&mut self) -> Option<&mut BindingIdent>
Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
sourcepub fn expect_ident(self) -> BindingIdentwhere
Self: Debug,
pub fn expect_ident(self) -> BindingIdentwhere
Self: Debug,
sourcepub fn ident(self) -> Option<BindingIdent>
pub fn ident(self) -> Option<BindingIdent>
Returns Some
if self
is of variant Ident
, and None
otherwise.
sourcepub fn as_array(&self) -> Option<&ArrayPat>
pub fn as_array(&self) -> Option<&ArrayPat>
Returns Some
if self
is a reference of variant Array
, and None
otherwise.
sourcepub fn as_mut_array(&mut self) -> Option<&mut ArrayPat>
pub fn as_mut_array(&mut self) -> Option<&mut ArrayPat>
Returns Some
if self
is a mutable reference of variant Array
, and None
otherwise.
sourcepub fn expect_array(self) -> ArrayPatwhere
Self: Debug,
pub fn expect_array(self) -> ArrayPatwhere
Self: Debug,
sourcepub fn array(self) -> Option<ArrayPat>
pub fn array(self) -> Option<ArrayPat>
Returns Some
if self
is of variant Array
, and None
otherwise.
sourcepub fn as_rest(&self) -> Option<&RestPat>
pub fn as_rest(&self) -> Option<&RestPat>
Returns Some
if self
is a reference of variant Rest
, and None
otherwise.
sourcepub fn as_mut_rest(&mut self) -> Option<&mut RestPat>
pub fn as_mut_rest(&mut self) -> Option<&mut RestPat>
Returns Some
if self
is a mutable reference of variant Rest
, and None
otherwise.
sourcepub fn expect_rest(self) -> RestPatwhere
Self: Debug,
pub fn expect_rest(self) -> RestPatwhere
Self: Debug,
sourcepub fn rest(self) -> Option<RestPat>
pub fn rest(self) -> Option<RestPat>
Returns Some
if self
is of variant Rest
, and None
otherwise.
sourcepub fn as_object(&self) -> Option<&ObjectPat>
pub fn as_object(&self) -> Option<&ObjectPat>
Returns Some
if self
is a reference of variant Object
, and None
otherwise.
sourcepub fn as_mut_object(&mut self) -> Option<&mut ObjectPat>
pub fn as_mut_object(&mut self) -> Option<&mut ObjectPat>
Returns Some
if self
is a mutable reference of variant Object
, and None
otherwise.