pub struct PolymorphicFunction { /* private fields */ }
Expand description
Represents a polymorphic function.
In this context, a polymorphic function has more than one type (i.e. signature); overload resolution is used to determine which signature binds to the function call.
Implementations§
Source§impl PolymorphicFunction
impl PolymorphicFunction
Sourcepub fn new(signatures: Vec<FunctionSignature>) -> Self
pub fn new(signatures: Vec<FunctionSignature>) -> Self
Sourcepub fn minimum_version(&self) -> SupportedVersion
pub fn minimum_version(&self) -> SupportedVersion
Gets the minimum WDL version required to call this function.
Sourcepub fn param_min_max(&self, version: SupportedVersion) -> Option<(usize, usize)>
pub fn param_min_max(&self, version: SupportedVersion) -> Option<(usize, usize)>
Gets the minimum and maximum number of parameters the function has for the given WDL version.
Returns None
if the function is not supported for the given version.
Sourcepub fn signatures(&self) -> &[FunctionSignature]
pub fn signatures(&self) -> &[FunctionSignature]
Gets the signatures of the function.
Sourcepub fn bind<'a>(
&'a self,
version: SupportedVersion,
arguments: &[Type],
) -> Result<Binding<'a>, FunctionBindError>
pub fn bind<'a>( &'a self, version: SupportedVersion, arguments: &[Type], ) -> Result<Binding<'a>, FunctionBindError>
Binds the function to the given arguments.
This performs overload resolution for the polymorphic function.
Trait Implementations§
Source§impl Debug for PolymorphicFunction
impl Debug for PolymorphicFunction
Source§impl From<PolymorphicFunction> for Function
impl From<PolymorphicFunction> for Function
Source§fn from(value: PolymorphicFunction) -> Self
fn from(value: PolymorphicFunction) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PolymorphicFunction
impl !RefUnwindSafe for PolymorphicFunction
impl Send for PolymorphicFunction
impl Sync for PolymorphicFunction
impl Unpin for PolymorphicFunction
impl !UnwindSafe for PolymorphicFunction
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