pub enum Function {
Monomorphic(MonomorphicFunction),
Polymorphic(PolymorphicFunction),
}
Expand description
Represents a WDL function.
Variants§
Monomorphic(MonomorphicFunction)
The function is monomorphic.
Polymorphic(PolymorphicFunction)
The function is polymorphic.
Implementations§
Source§impl Function
impl Function
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 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.
Sourcepub fn realize_unconstrained_return_type(&self, arguments: &[Type]) -> Type
pub fn realize_unconstrained_return_type(&self, arguments: &[Type]) -> Type
Realizes the return type of the function without constraints.
This is typically called after a failure to bind a function so that the return type can be calculated despite the failure.
As such, it attempts to realize any type parameters without constraints, as an unsatisfied constraint likely caused the bind failure.
Trait Implementations§
Source§impl From<MonomorphicFunction> for Function
impl From<MonomorphicFunction> for Function
Source§fn from(value: MonomorphicFunction) -> Self
fn from(value: MonomorphicFunction) -> Self
Converts to this type from the input type.
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 Function
impl !RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl !UnwindSafe for Function
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