Skip to main content

Engine

Struct Engine 

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

The engine: answers the value of a cell as of a time. See the crate documentation.

Implementations§

Source§

impl Engine

Source

pub fn builder( store: Arc<dyn Store + Send + Sync>, host: impl Into<String>, ) -> EngineBuilder

A builder for an engine on store, signing as the mesh host.

Source

pub fn get( &self, cell: &CellRef, asof: Option<&str>, ) -> Result<Answer, EngineError>

The value of the cell cell denotes, as of asof (else cell.asof, else now).

The function name resolves as of the asof; with no binding then, the answer is Answer::NotCovered. See the crate documentation for the answers and errors.

Source

pub fn get_cell( &self, cell: &Cell, asof: Option<&str>, ) -> Result<Answer, EngineError>

The value of cell (its function pinned by fn_hash), as of asof (else now). The form for a reference that already carries the function hash. An unknown function hash is Answer::NotCovered.

Source

pub fn stored_version_added(&self, cell_id: &str)

Tells the engine that a stored version of cell_id was added: the memoised answers that depend on the cell are dropped.

Source

pub fn clear_memo(&self)

Drops every memoised answer.

Source

pub fn memo_stats(&self) -> MemoStats

Sizes of the memo and of the dirty set.

Trait Implementations§

Source§

impl Debug for Engine

Source§

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

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

impl Resolver for Engine

Source§

fn evaluate(&self, cell: &Cell, asof: &str) -> Option<Scalar>

The value of cell as of asof by the engine’s answering rule (a receipt answers at A when its tx and its asof are both at or before A): a stored cell’s is looked up; a computed cell’s function is evaluated (its inputs answered as for get, and stored when new), never read back from its own receipts. None when there is none or the evaluation fails (logged with tracing, target datumesh_engine).

Source§

fn descriptor(&self, fn_hash: &str) -> Option<Cow<'_, [u8]>>

The descriptor JSON text offered for fn_hash, or None if unavailable (E_FN_UNAVAILABLE). Only None is unavailability: the text is parsed strictly (unparseable text reports its parse code), and any other JSON value, null included, is a descriptor offered that fails the hash check (E_FN_HASH_MISMATCH, SPEC 10.1 step 7.1).
Source§

fn receipt(&self, hash: &str) -> Option<Cow<'_, [u8]>>

The receipt JSON text offered for receipt hash hash, or None if unavailable (E_INPUT_UNAVAILABLE).

Auto Trait Implementations§

§

impl !Freeze for Engine

§

impl !RefUnwindSafe for Engine

§

impl !UnwindSafe for Engine

§

impl Send for Engine

§

impl Sync for Engine

§

impl Unpin for Engine

§

impl UnsafeUnpin for Engine

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<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> Same for T

Source§

type Output = T

Should always be Self
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.
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