pub struct FunctionSignature {
pub meta: Option<Meta>,
pub name: String,
pub module_name: Option<String>,
pub type_handle: Option<TypeHandle>,
pub visibility: Visibility,
pub inputs: Vec<FunctionParameter>,
pub outputs: Vec<FunctionParameter>,
}Expand description
Everything about a function except its body.
The signature is also the identity of a function: a registry refuses to hold two functions whose signatures are equal.
type_handle is set when the function belongs to a type, which is how
methods are modelled.
Fields§
§meta: Option<Meta>Metadata attached to this function.
name: StringName the function is registered under.
module_name: Option<String>Module the function belongs to.
type_handle: Option<TypeHandle>Type the function is a method of, if any.
visibility: VisibilityHow widely the function is visible.
inputs: Vec<FunctionParameter>Arguments, in declaration order.
outputs: Vec<FunctionParameter>Results, in declaration order.
Implementations§
Source§impl FunctionSignature
impl FunctionSignature
Sourcepub fn with_module_name(self, name: impl ToString) -> Self
pub fn with_module_name(self, name: impl ToString) -> Self
Sets the owning module, builder style.
Sourcepub fn with_type_handle(self, handle: TypeHandle) -> Self
pub fn with_type_handle(self, handle: TypeHandle) -> Self
Makes this a method of the given type, builder style.
Sourcepub fn with_visibility(self, visibility: Visibility) -> Self
pub fn with_visibility(self, visibility: Visibility) -> Self
Sets visibility, builder style.
Sourcepub fn with_input(self, parameter: FunctionParameter) -> Self
pub fn with_input(self, parameter: FunctionParameter) -> Self
Appends an input, builder style.
Sourcepub fn with_output(self, parameter: FunctionParameter) -> Self
pub fn with_output(self, parameter: FunctionParameter) -> Self
Appends an output, builder style.
Trait Implementations§
Source§impl Clone for FunctionSignature
impl Clone for FunctionSignature
Source§fn clone(&self) -> FunctionSignature
fn clone(&self) -> FunctionSignature
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionSignature
impl Debug for FunctionSignature
Source§impl Display for FunctionSignature
impl Display for FunctionSignature
Source§impl PartialEq for FunctionSignature
impl PartialEq for FunctionSignature
impl StructuralPartialEq for FunctionSignature
Auto Trait Implementations§
impl Freeze for FunctionSignature
impl RefUnwindSafe for FunctionSignature
impl Send for FunctionSignature
impl Sync for FunctionSignature
impl Unpin for FunctionSignature
impl UnsafeUnpin for FunctionSignature
impl UnwindSafe for FunctionSignature
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