pub struct VectorFunctionTaskExpression {
pub path: RemotePath,
pub skip: Option<Expression>,
pub map: Option<Expression>,
pub input: WithExpression<InputValueExpression>,
pub output: Expression,
}Expand description
Expression for a task that calls a vector function (pre-compilation).
Fields§
§path: RemotePath§skip: Option<Expression>If this expression evaluates to true, skip the task. Receives: input.
map: Option<Expression>Expression that evaluates to the number of mapped task instances.
Each instance receives map as an integer index (0-based).
input: WithExpression<InputValueExpression>Expression for the input to pass to the function.
Receives: input, map (if mapped).
output: ExpressionExpression to transform the task result into a valid function output.
Receives output which is one of 4 variants:
Scalar(Decimal)- a single scoreVector(Vec<Decimal>)- a vector of scoresVectors(Vec<Vec<Decimal>>)- multiple vectors (from mapped tasks)Err(Value)- an error
The expression must return a TaskOutputOwned that is valid for the parent function’s type:
- For scalar functions: must return
Scalar(value)where value is in [0, 1] - For vector functions: must return
Vector(values)where values sum to ~1 and match the expected length
The function’s final output is computed as a weighted average of all task outputs using profile weights. If a function has only one task, that task’s output becomes the function’s output directly.
Implementations§
Source§impl VectorFunctionTaskExpression
impl VectorFunctionTaskExpression
pub fn url(&self) -> String
Sourcepub fn compile(
self,
params: &Params<'_, '_>,
) -> Result<VectorFunctionTask, ExpressionError>
pub fn compile( self, params: &Params<'_, '_>, ) -> Result<VectorFunctionTask, ExpressionError>
Compiles the expression into a concrete VectorFunctionTask.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for VectorFunctionTaskExpression
impl<'arbitrary> Arbitrary<'arbitrary> for VectorFunctionTaskExpression
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for VectorFunctionTaskExpression
impl Clone for VectorFunctionTaskExpression
Source§fn clone(&self) -> VectorFunctionTaskExpression
fn clone(&self) -> VectorFunctionTaskExpression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VectorFunctionTaskExpression
impl Debug for VectorFunctionTaskExpression
Source§impl<'de> Deserialize<'de> for VectorFunctionTaskExpression
impl<'de> Deserialize<'de> for VectorFunctionTaskExpression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for VectorFunctionTaskExpression
impl JsonSchema for VectorFunctionTaskExpression
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for VectorFunctionTaskExpression
impl PartialEq for VectorFunctionTaskExpression
Source§fn eq(&self, other: &VectorFunctionTaskExpression) -> bool
fn eq(&self, other: &VectorFunctionTaskExpression) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VectorFunctionTaskExpression
Auto Trait Implementations§
impl Freeze for VectorFunctionTaskExpression
impl RefUnwindSafe for VectorFunctionTaskExpression
impl Send for VectorFunctionTaskExpression
impl Sync for VectorFunctionTaskExpression
impl Unpin for VectorFunctionTaskExpression
impl UnsafeUnpin for VectorFunctionTaskExpression
impl UnwindSafe for VectorFunctionTaskExpression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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