Skip to main content

AlgorithmSignature

Struct AlgorithmSignature 

Source
pub struct AlgorithmSignature {
    pub output_fields: Vec<Field>,
    pub docs: String,
    pub args: Vec<NamedArgType>,
    pub slices: Vec<SliceReq>,
    pub df_composable: bool,
}
Expand description

Static signature of an algorithm.

args and slices are additive, defaulted fields (construct with ..Default::default()): existing providers that leave them empty keep the legacy untyped config_json contract unchanged. A provider that declares args opts into host-side arity/type validation before it runs (proposal §4.6 / decision D7); a provider that declares slices opts into load-time capability-slice version negotiation (proposal §4.3 / decision D6).

Fields§

§output_fields: Vec<Field>

Output column schema.

§docs: String

Markdown docs.

§args: Vec<NamedArgType>

Declared positional arguments, in call order.

Empty (the default) preserves the legacy behavior: arguments arrive as a raw positional config_json array the provider parses itself. When non-empty, the host validates arity and coerces each positional argument against the declared NamedArgType before the provider runs, filling omitted trailing arguments from their declared defaults.

§slices: Vec<SliceReq>

Required capability slices, checked at load time.

Empty (the default) means the algorithm targets only the always-present graph-compute@1 surface. A declared SliceReq whose version the host does not provide fails the load with a clear error (0x86A) rather than a mysterious runtime “unknown kernel op” trap.

§df_composable: bool

Whether a CALL of this algorithm may be planned as a first-class DataFusion ExecutionPlan node (the vectorized path), rather than only through the row-based interpreter (proposal §6, DF-3).

false (the default) preserves the row path. A provider sets this true to declare it composes correctly as a leaf/source plan node — its run returns a well-formed RecordBatch stream matching output_fields, and it consumes MATCH-bound arguments via outer_values rather than a child plan. This replaces the previous name-prefix allowlist (uni.algo.*): eligibility is now registration-driven, so a third-party myco.algo.* provider that declares df_composable is a first-class plan node like the first-party ones, and a uni.algo.-named provider that does not declare it no longer gets the DF path by prefix alone.

Implementations§

Source§

impl AlgorithmSignature

Source

pub fn check_slices(&self, host_slices: &[(&str, u16)]) -> Result<(), FnError>

Validates the declared capability slices against host_slices.

Each requirement must be met by a host slice of the same name whose version is at least the requested one. Pass HOST_CAPABILITY_SLICES for the production surface.

§Errors

Returns 0x86A (SliceVersionMismatch) naming the first requirement the host cannot satisfy (proposal §4.3 / §12, decision D6).

Source

pub fn coerce_config_json(&self, config_json: &str) -> Result<String, FnError>

Validates and normalizes a positional config_json array against args.

When args is empty this is a no-op returning config_json unchanged, so providers on the legacy untyped contract are unaffected. Otherwise it parses the positional JSON array and, per declared argument: rejects a present value whose JSON kind is incompatible with the declared ArgType, errors on a missing argument that has no default, and appends the declared default for an omitted trailing argument. Extra positional arguments beyond the declared arity are rejected. The returned JSON array is what the provider then parses, so it observes defaults already filled in.

§Errors

Returns 0x86E (argument arity/type violation) with a message naming the offending argument (proposal §4.6, decision D7).

Trait Implementations§

Source§

impl Clone for AlgorithmSignature

Source§

fn clone(&self) -> AlgorithmSignature

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AlgorithmSignature

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AlgorithmSignature

Source§

fn default() -> AlgorithmSignature

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PluginState for T
where T: Send + Sync + 'static,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more