[][src]Struct proffer::function_gen::FunctionSignature

pub struct FunctionSignature { /* fields omitted */ }

Represents a function/method signature in source code

Methods

impl FunctionSignature[src]

pub fn new<S: ToString>(name: S) -> Self[src]

Create a new function signature.

pub fn set_is_async(&mut self, is_async: bool) -> &mut Self[src]

Set this function as async

pub fn add_parameter(&mut self, param: Parameter) -> &mut Self[src]

Add a parameter to this signature

pub fn add_generic(&mut self, generic: Generic) -> &mut Self[src]

Add a generic to this signature

pub fn set_return_ty<S: ToString>(&mut self, ty: Option<S>) -> &mut Self[src]

Set a return type, if None will result in () type.

pub fn set_is_pub(&mut self, is_pub: bool) -> &mut Self[src]

Set if this signature should be prefixed with pub

pub fn set_name<S: ToString>(&mut self, name: S) -> &mut Self[src]

Set the name of this function.

Trait Implementations

impl SrcCode for FunctionSignature[src]

impl Clone for FunctionSignature[src]

impl Default for FunctionSignature[src]

impl Serialize for FunctionSignature[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]