pub struct Function { /* private fields */ }Expand description
A function declaration.
Implementations§
Trait Implementations§
Source§impl Statement for Function
impl Statement for Function
Source§fn write(&self, b: &mut CodeBuffer, level: usize)
fn write(&self, b: &mut CodeBuffer, level: usize)
Writes the code to the buffer
b at the indent level.Source§impl WithAccess for Function
impl WithAccess for Function
Source§fn set_access<A>(&mut self, access: A)
fn set_access<A>(&mut self, access: A)
Sets the
access level.Source§fn with_access<A>(self, access: A) -> Self
fn with_access<A>(self, access: A) -> Self
Sets the
access level.Source§fn write_access(&self, b: &mut CodeBuffer)
fn write_access(&self, b: &mut CodeBuffer)
Writes the access level.
Source§impl WithAttributes for Function
impl WithAttributes for Function
Source§fn attributes(&self) -> &[String]
fn attributes(&self) -> &[String]
Gets the attributes.
Source§fn add_attribute<S>(&mut self, attribute: S)
fn add_attribute<S>(&mut self, attribute: S)
Adds the attribute.
Source§fn with_attribute<S>(self, attribute: S) -> Self
fn with_attribute<S>(self, attribute: S) -> Self
Adds the attribute.
Source§fn write_attributes(&self, b: &mut CodeBuffer, level: usize)
fn write_attributes(&self, b: &mut CodeBuffer, level: usize)
Writes the attributes.
Source§impl WithComments for Function
impl WithComments for Function
Source§fn add_comment<S>(&mut self, comment: S)
fn add_comment<S>(&mut self, comment: S)
Adds the
comment line.Source§fn with_comment<S>(self, comment: S) -> Self
fn with_comment<S>(self, comment: S) -> Self
Adds the
comment line.Source§fn write_comments(
&self,
comment_type: CommentType,
b: &mut CodeBuffer,
level: usize,
)
fn write_comments( &self, comment_type: CommentType, b: &mut CodeBuffer, level: usize, )
Writes the comment lines.
Source§impl WithSignature for Function
impl WithSignature for Function
Source§fn write_signature(&self, b: &mut CodeBuffer)
fn write_signature(&self, b: &mut CodeBuffer)
Writes the function signature.
Source§impl WithStatements for Function
impl WithStatements for Function
Source§fn statements(&self) -> &[Box<dyn Statement>]
fn statements(&self) -> &[Box<dyn Statement>]
Gets the statements.
Source§fn add_boxed_statement(&mut self, statement: Box<dyn Statement>)
fn add_boxed_statement(&mut self, statement: Box<dyn Statement>)
Adds the boxed
statement.Source§fn with_boxed_statement(self, statement: Box<dyn Statement>) -> Self
fn with_boxed_statement(self, statement: Box<dyn Statement>) -> Self
Adds the boxed
statement.Source§fn add_statement<S>(&mut self, statement: S)where
S: 'static + Statement,
fn add_statement<S>(&mut self, statement: S)where
S: 'static + Statement,
Adds the
statement.Source§fn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
fn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
Adds the
statement.Source§fn add_literal<L>(&mut self, literal: L)
fn add_literal<L>(&mut self, literal: L)
Adds the
literal statement.Source§fn with_literal<L>(self, literal: L) -> Self
fn with_literal<L>(self, literal: L) -> Self
Adds the
literal statement.Source§fn add_expression_statement<E>(&mut self, expression: E)where
E: 'static + Expression,
fn add_expression_statement<E>(&mut self, expression: E)where
E: 'static + Expression,
Adds the
expression as a statement.Source§fn with_expression_statement<E>(self, expression: E) -> Selfwhere
E: 'static + Expression,
fn with_expression_statement<E>(self, expression: E) -> Selfwhere
E: 'static + Expression,
Adds the
expression as a statement.Source§fn write_statements(&self, b: &mut CodeBuffer, level: usize)
fn write_statements(&self, b: &mut CodeBuffer, level: usize)
Writes the statements.
Source§fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)
fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)
Writes the curly-bracketed statement block. (
level is the outer level)Auto Trait Implementations§
impl Freeze for Function
impl !RefUnwindSafe for Function
impl !Send for Function
impl !Sync for Function
impl Unpin 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