pub struct FunctionSignatureBuilder(/* private fields */);
Expand description
Represents a function signature builder.
Implementations§
Source§impl FunctionSignatureBuilder
impl FunctionSignatureBuilder
Sourcepub fn min_version(self, version: SupportedVersion) -> Self
pub fn min_version(self, version: SupportedVersion) -> Self
Sets the minimum required version for the function signature.
Sourcepub fn type_parameter(
self,
name: &'static str,
constraint: impl Constraint + 'static,
) -> Self
pub fn type_parameter( self, name: &'static str, constraint: impl Constraint + 'static, ) -> Self
Adds a constrained type parameter to the function signature.
Sourcepub fn any_type_parameter(self, name: &'static str) -> Self
pub fn any_type_parameter(self, name: &'static str) -> Self
Adds an unconstrained type parameter to the function signature.
Sourcepub fn parameter(self, ty: impl Into<FunctionalType>) -> Self
pub fn parameter(self, ty: impl Into<FunctionalType>) -> Self
Adds a parameter to the function signature.
Sourcepub fn ret(self, ret: impl Into<FunctionalType>) -> Self
pub fn ret(self, ret: impl Into<FunctionalType>) -> Self
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) -> Self
pub fn required(self, required: usize) -> Self
Sets the number of required parameters in the function signature.
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 Freeze for FunctionSignatureBuilder
impl !RefUnwindSafe for FunctionSignatureBuilder
impl Send for FunctionSignatureBuilder
impl Sync for FunctionSignatureBuilder
impl Unpin for FunctionSignatureBuilder
impl !UnwindSafe 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
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