Struct valkyrie_ast::FunctionDeclaration
source · pub struct FunctionDeclaration {
pub name: NamePathNode,
pub kind: FunctionKind,
pub annotations: AnnotationNode,
pub generics: ParametersList,
pub parameters: ParametersList,
pub returns: FunctionReturnNode,
pub body: StatementBlock,
}Expand description
class Name(Super): Trait {}
Fields§
§name: NamePathNodeThe belonging and name of this function
kind: FunctionKindThe range of the number.
annotations: AnnotationNodeThe annotations of this function
generics: ParametersListThy type parameters of this function
parameters: ParametersListThe value parameters of this function
returns: FunctionReturnNodeThe return type of this function
body: StatementBlockThe body of this function
Implementations§
source§impl FunctionDeclaration
impl FunctionDeclaration
sourcepub fn has_return_type(&self) -> bool
pub fn has_return_type(&self) -> bool
Does the function has a return type
sourcepub fn omit_return(&self) -> bool
pub fn omit_return(&self) -> bool
Does the last statement has a semicolon, or it’s empty
Omit return always returns ( )
Trait Implementations§
source§impl Clone for FunctionDeclaration
impl Clone for FunctionDeclaration
source§fn clone(&self) -> FunctionDeclaration
fn clone(&self) -> FunctionDeclaration
Returns a copy 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 FunctionDeclaration
impl Debug for FunctionDeclaration
source§impl From<FunctionDeclaration> for StatementKind
impl From<FunctionDeclaration> for StatementKind
source§fn from(o: FunctionDeclaration) -> Self
fn from(o: FunctionDeclaration) -> Self
Converts to this type from the input type.
source§impl Hash for FunctionDeclaration
impl Hash for FunctionDeclaration
source§impl PartialEq for FunctionDeclaration
impl PartialEq for FunctionDeclaration
source§fn eq(&self, other: &FunctionDeclaration) -> bool
fn eq(&self, other: &FunctionDeclaration) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for FunctionDeclaration
impl StructuralPartialEq for FunctionDeclaration
Auto Trait Implementations§
impl RefUnwindSafe for FunctionDeclaration
impl Send for FunctionDeclaration
impl Sync for FunctionDeclaration
impl Unpin for FunctionDeclaration
impl UnwindSafe for FunctionDeclaration
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