pub struct FunctionDef<Mods, Name, Args, Return, Where, Body> {
pub mods: Mods,
pub name: Name,
pub args: Args,
pub return_type: Return,
pub where_conds: Where,
pub body: Body,
}Expand description
A function declaration
Fields§
§mods: ModsThe modifiers. Must be a sequence.
name: NameThe function name. Type variables can be declared here via Parameterized
args: ArgsThe arguments. Must be a sequence
return_type: ReturnThe return type, i.e. after the -> arrow
where_conds: WhereThe “where” conditions. Must be a sequence. Set to NoOp to disable.
Will render as where C1, C2, C3, ... where CX is a value in the sequence.
body: BodyThe function body.
To only declare the function, this must be ; so use FunctionBodyDeclare
To implement the function, use FunctionBodyImplement
Trait Implementations§
Source§impl<Mods, Name, Args, Return, Where, Body> CanHaveAttributes for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods, Name, Args, Return, Where, Body> CanHaveAttributes for FunctionDef<Mods, Name, Args, Return, Where, Body>
Source§fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>
fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>
Adds attributes to this writable
Source§impl<Mods: Clone, Name: Clone, Args: Clone, Return: Clone, Where: Clone, Body: Clone> Clone for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods: Clone, Name: Clone, Args: Clone, Return: Clone, Where: Clone, Body: Clone> Clone for FunctionDef<Mods, Name, Args, Return, Where, Body>
Source§fn clone(&self) -> FunctionDef<Mods, Name, Args, Return, Where, Body>
fn clone(&self) -> FunctionDef<Mods, Name, Args, Return, Where, Body>
Returns a duplicate 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<Mods: Debug, Name: Debug, Args: Debug, Return: Debug, Where: Debug, Body: Debug> Debug for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods: Debug, Name: Debug, Args: Debug, Return: Debug, Where: Debug, Body: Debug> Debug for FunctionDef<Mods, Name, Args, Return, Where, Body>
Source§impl<O, Mods, Name, Args, Return, Where, Body> Writable<O> for FunctionDef<Mods, Name, Args, Return, Where, Body>where
O: Output,
Mods: WritableSeq<O>,
Name: Writable<O>,
Args: WritableSeq<O>,
Return: Writable<O>,
Where: WritableSeq<O>,
Body: Writable<O>,
impl<O, Mods, Name, Args, Return, Where, Body> Writable<O> for FunctionDef<Mods, Name, Args, Return, Where, Body>where
O: Output,
Mods: WritableSeq<O>,
Name: Writable<O>,
Args: WritableSeq<O>,
Return: Writable<O>,
Where: WritableSeq<O>,
Body: Writable<O>,
Auto Trait Implementations§
impl<Mods, Name, Args, Return, Where, Body> Freeze for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods, Name, Args, Return, Where, Body> RefUnwindSafe for FunctionDef<Mods, Name, Args, Return, Where, Body>where
Mods: RefUnwindSafe,
Name: RefUnwindSafe,
Args: RefUnwindSafe,
Return: RefUnwindSafe,
Where: RefUnwindSafe,
Body: RefUnwindSafe,
impl<Mods, Name, Args, Return, Where, Body> Send for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods, Name, Args, Return, Where, Body> Sync for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods, Name, Args, Return, Where, Body> Unpin for FunctionDef<Mods, Name, Args, Return, Where, Body>
impl<Mods, Name, Args, Return, Where, Body> UnwindSafe for FunctionDef<Mods, Name, Args, Return, Where, Body>where
Mods: UnwindSafe,
Name: UnwindSafe,
Args: UnwindSafe,
Return: UnwindSafe,
Where: UnwindSafe,
Body: UnwindSafe,
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