pub struct Function {
pub attributes: Vec<Spanned<Attribute>>,
pub visibility: Visibility,
pub ident: Ident,
pub parameters: Vec<FormalParameter>,
pub return_attributes: Vec<Spanned<Attribute>>,
pub return_type: Option<TypeExpression>,
pub body: CompoundStatement,
}Fields§
§attributes: Vec<Spanned<Attribute>>§visibility: Visibility§ident: Ident§parameters: Vec<FormalParameter>§return_attributes: Vec<Spanned<Attribute>>§return_type: Option<TypeExpression>§body: CompoundStatementImplementations§
Trait Implementations§
Source§impl From<Function> for GlobalDeclaration
impl From<Function> for GlobalDeclaration
Source§fn from(value: Function) -> GlobalDeclaration
fn from(value: Function) -> GlobalDeclaration
Converts to this type from the input type.
impl StructuralPartialEq for Function
Source§impl SyntaxNode for Function
impl SyntaxNode for Function
Source§fn attributes(&self) -> &[Spanned<Attribute>]
fn attributes(&self) -> &[Spanned<Attribute>]
List all attributes of a syntax node.
Source§fn attributes_mut(&mut self) -> &mut [Spanned<Attribute>]
fn attributes_mut(&mut self) -> &mut [Spanned<Attribute>]
List all attributes of a syntax node.
Source§fn retain_attributes_mut<F>(&mut self, f: F)
fn retain_attributes_mut<F>(&mut self, f: F)
Remove attributes with predicate.
Source§fn contains_attribute(&self, attribute: &Attribute) -> bool
fn contains_attribute(&self, attribute: &Attribute) -> bool
Whether the node contains an attribute.
Source§impl Visit<TypeExpression> for Function
impl Visit<TypeExpression> for Function
Source§fn visit<'a>(&'a self) -> impl Iterator<Item = &'a TypeExpression>where
TypeExpression: 'a,
fn visit<'a>(&'a self) -> impl Iterator<Item = &'a TypeExpression>where
TypeExpression: 'a,
Source§fn visit_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut TypeExpression>where
TypeExpression: 'a,
fn visit_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut TypeExpression>where
TypeExpression: 'a,
Mutable version of
Self::visit.Source§fn visit_rec_mut<'a, F>(&'a mut self, f: &mut F)
fn visit_rec_mut<'a, F>(&'a mut self, f: &mut F)
Mutable version of
Self::visit_rec.Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more