pub struct Function { /* private fields */ }
Expand description
Defines a function.
Implementations
sourceimpl Function
impl Function
sourcepub fn arg_ref_self(&mut self) -> &mut Self
pub fn arg_ref_self(&mut self) -> &mut Self
Add &self
as a function argument.
sourcepub fn arg_mut_self(&mut self) -> &mut Self
pub fn arg_mut_self(&mut self) -> &mut Self
Add &mut self
as a function argument.
sourcepub fn arg<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
pub fn arg<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
Add a function argument.
sourcepub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
pub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
Add a where
bound to the function.
sourcepub fn line<T>(&mut self, line: T) -> &mut Selfwhere
T: ToString,
pub fn line<T>(&mut self, line: T) -> &mut Selfwhere
T: ToString,
Push a line to the function implementation.
sourcepub fn push_block(&mut self, block: Block) -> &mut Self
pub fn push_block(&mut self, block: Block) -> &mut Self
Push a block to the function implementation
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more