Struct swc_ecma_ast::Function
source · [−]pub struct Function {
pub params: Vec<Param>,
pub decorators: Vec<Decorator>,
pub span: Span,
pub body: Option<BlockStmt>,
pub is_generator: bool,
pub is_async: bool,
pub type_params: Option<Box<TsTypeParamDecl>>,
pub return_type: Option<Box<TsTypeAnn>>,
}
Expand description
Common parts of function and method.
Fields
params: Vec<Param>
decorators: Vec<Decorator>
span: Span
body: Option<BlockStmt>
is_generator: bool
if it’s a generator.
is_async: bool
if it’s an async function.
type_params: Option<Box<TsTypeParamDecl>>
return_type: Option<Box<TsTypeAnn>>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Function
impl EqIgnoreSpan for Function
fn eq_ignore_span(&self, other: &Self) -> bool
impl Eq for Function
impl StructuralEq for Function
impl StructuralPartialEq for Function
Auto Trait Implementations
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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