Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }
Expand description

A registry, its backends, and a cache of loaded transforms. See the module docs.

Implementations§

Source§

impl Runtime

Source

pub fn builder() -> RuntimeBuilder

Start building a runtime: add roots and backends, then RuntimeBuilder::build.

Source

pub fn new(registry: Registry, backends: Backends) -> Self

Wrap an already-built registry and backend set.

Source

pub fn registry(&self) -> &Registry

The transforms this runtime can see.

Source

pub fn backends(&self) -> &Backends

The backends this runtime dispatches to.

Source

pub fn load(&self, selector: &str) -> Result<Arc<dyn Compute>, ComputeError>

Resolve selector (id or id@version) and load it through its backend. The loaded transform is cached by selector, so repeated calls are a map lookup; the expensive work (compiling a component, resolving an image) happens once.

Source

pub fn run( &self, selector: &str, inputs: &[RecordBatch], ) -> Result<RecordBatch, ComputeError>

Load (cached) and run selector over inputs, one batch per declared input.

Source

pub fn ensure_loadable(&self, selector: &str) -> Result<(), ComputeError>

Load selector without running it. Call this when a job is configured, so a missing or broken transform fails the job up front instead of failing every batch later.

Source

pub fn clear_cache(&self)

Drop every cached transform. The next load of each selector goes through its backend again — use after the transform directories change on disk.

Trait Implementations§

Source§

impl Debug for Runtime

Source§

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

Formats the value using the given formatter. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.