pub struct Function {
pub doc: Doc,
pub decorators: Vec<Decorator>,
pub name: Ident,
pub params: Vec<Param>,
pub returns: Option<Type>,
pub body: Vec<Statement>,
}Expand description
def name(params) -> returns: ...
Fields§
§doc: DocThe docstring, written as the first statement of the body.
decorators: Vec<Decorator>Decorators, in written order, outermost first.
name: IdentThe name.
params: Vec<Param>The parameters, in written order.
returns: Option<Type>The return annotation. None leaves it unwritten, which is not
the same as -> None: the first says nothing and the second says
the function answers with nothing.
body: Vec<Statement>The body, in written order; never empty.
Trait Implementations§
impl Eq for Function
impl StructuralPartialEq for Function
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