[−][src]Struct proffer::function_gen::FunctionSignature
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]
fn clone(&self) -> FunctionSignature
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for FunctionSignature
[src]
fn default() -> FunctionSignature
[src]
impl Serialize for FunctionSignature
[src]
Auto Trait Implementations
impl Send for FunctionSignature
impl Sync for FunctionSignature
impl Unpin for FunctionSignature
impl UnwindSafe for FunctionSignature
impl RefUnwindSafe for FunctionSignature
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,