pub struct FunctionSignatureBuilder(/* private fields */);Expand description
Represents a function signature builder.
Implementations§
Source§impl FunctionSignatureBuilder
impl FunctionSignatureBuilder
Sourcepub fn new() -> FunctionSignatureBuilder
pub fn new() -> FunctionSignatureBuilder
Constructs a new function signature builder.
Sourcepub fn min_version(self, version: SupportedVersion) -> FunctionSignatureBuilder
pub fn min_version(self, version: SupportedVersion) -> FunctionSignatureBuilder
Sets the minimum required version for the function signature.
Sourcepub fn type_parameter(
self,
name: &'static str,
constraint: impl Constraint + 'static,
) -> FunctionSignatureBuilder
pub fn type_parameter( self, name: &'static str, constraint: impl Constraint + 'static, ) -> FunctionSignatureBuilder
Adds a constrained type parameter to the function signature.
Sourcepub fn any_type_parameter(self, name: &'static str) -> FunctionSignatureBuilder
pub fn any_type_parameter(self, name: &'static str) -> FunctionSignatureBuilder
Adds an unconstrained type parameter to the function signature.
Sourcepub fn parameter(
self,
name: &'static str,
ty: impl Into<FunctionalType>,
description: &'static str,
) -> FunctionSignatureBuilder
pub fn parameter( self, name: &'static str, ty: impl Into<FunctionalType>, description: &'static str, ) -> FunctionSignatureBuilder
Adds a parameter to the function signature.
Sourcepub fn ret(self, ret: impl Into<FunctionalType>) -> FunctionSignatureBuilder
pub fn ret(self, ret: impl Into<FunctionalType>) -> FunctionSignatureBuilder
Sets the return value in the function signature.
If this is not called, the function signature will return a Union
type.
Sourcepub fn required(self, required: usize) -> FunctionSignatureBuilder
pub fn required(self, required: usize) -> FunctionSignatureBuilder
Sets the number of required parameters in the function signature.
Sourcepub fn definition(self, definition: &'static str) -> FunctionSignatureBuilder
pub fn definition(self, definition: &'static str) -> FunctionSignatureBuilder
Sets the definition of the function.
Sourcepub fn build(self) -> FunctionSignature
pub fn build(self) -> FunctionSignature
Consumes the builder and produces the function signature.
§Panics
This method panics if the function signature is invalid.
Trait Implementations§
Source§impl Debug for FunctionSignatureBuilder
impl Debug for FunctionSignatureBuilder
Source§impl Default for FunctionSignatureBuilder
impl Default for FunctionSignatureBuilder
Source§fn default() -> FunctionSignatureBuilder
fn default() -> FunctionSignatureBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionSignatureBuilder
impl !UnwindSafe for FunctionSignatureBuilder
impl Freeze for FunctionSignatureBuilder
impl Send for FunctionSignatureBuilder
impl Sync for FunctionSignatureBuilder
impl Unpin for FunctionSignatureBuilder
impl UnsafeUnpin for FunctionSignatureBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more