pub type ArrowFunction = FunctionBase<ArrowFunctionBase>;

Aliased Type§

struct ArrowFunction {
    pub header: Option<Keyword<Async>>,
    pub name: (),
    pub type_parameters: Option<Vec<GenericTypeConstraint, Global>>,
    pub parameters: FunctionParameters,
    pub return_type: Option<TypeAnnotation>,
    pub body: ExpressionOrBlock,
    pub position: BaseSpan<()>,
}

Fields§

§header: Option<Keyword<Async>>§name: ()§type_parameters: Option<Vec<GenericTypeConstraint, Global>>§parameters: FunctionParameters§return_type: Option<TypeAnnotation>§body: ExpressionOrBlock§position: BaseSpan<()>

Trait Implementations§

source§

impl<T: FunctionBased + 'static> ASTNode for FunctionBase<T>

source§

fn from_reader( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, settings: &ParseOptions ) -> ParseResult<Self>

source§

fn to_string_from_buffer<TS: ToString>( &self, buf: &mut TS, settings: &ToStringOptions, depth: u8 )

source§

fn get_position(&self) -> &Span

Returns position of node as span AS IT WAS PARSED. May be Span::NULL if AST was doesn’t match anything in source
source§

fn from_string( script: String, options: ParseOptions, source: SourceId, offset: Option<u32> ) -> ParseResult<Self>

From string, with default impl to call abstract method from_reader
source§

fn to_string(&self, settings: &ToStringOptions) -> String

Returns structure as valid string
source§

impl<T: Clone + FunctionBased> Clone for FunctionBase<T>where T::Header: Clone, T::Name: Clone, T::Body: Clone,

source§

fn clone(&self) -> FunctionBase<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + FunctionBased> Debug for FunctionBase<T>where T::Header: Debug, T::Name: Debug, T::Body: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: FunctionBased> GetFieldByType<BaseSpan<()>> for FunctionBase<T>

source§

fn get(&self) -> &Span

Get the value of a field that has type T
source§

impl<T: FunctionBased> PartialEq<FunctionBase<T>> for FunctionBase<T>where T::Header: PartialEq, T::Name: PartialEq, T::Body: PartialEq,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: FunctionBased> SelfRustTokenize for FunctionBase<T>where T::Header: SelfRustTokenize, T::Name: SelfRustTokenize, T::Body: SelfRustTokenize,

source§

fn append_to_token_stream(&self, token_stream: &mut TokenStream)

source§

fn to_tokens(&self) -> TokenStream

Returns the tokens used to construct self
source§

impl<T: FunctionBased> Serialize for FunctionBase<T>where T::Header: Serialize, T::Name: Serialize, T::Body: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: FunctionBased> Visitable for FunctionBase<T>where T::Body: Visitable,

Visiting logic: TODO make visiting macro better and remove

source§

fn visit<TData>( &self, visitors: &mut (impl VisitorReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )

source§

fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )

source§

impl<T: FunctionBased> Eq for FunctionBase<T>