Skip to main content

Engine

Struct Engine 

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

The install engine, bound to a $VANTA_HOME.

Implementations§

Source§

impl Engine

Source

pub fn open(home: impl AsRef<Path>) -> VtaResult<Engine>

Open the engine over home ($VANTA_HOME) with the default (permissive) policy — checksum-gated, signatures verified when present. Use Engine::open_with_policy to require signatures.

Source

pub fn open_with_policy( home: impl AsRef<Path>, policy: Policy, ) -> VtaResult<Engine>

Open the engine with an explicit verification Policy (audit H2).

Source

pub fn with_max_decompressed(self, max: u64) -> Self

Override the decompressed-size ceiling (audit M8).

Source

pub fn store(&self) -> &Store

Borrow the underlying store / state (for gc, which, etc.).

Source

pub fn state(&self) -> &State

Source

pub fn install_artifact( &self, tool: &str, version: &str, artifact: &Artifact, ) -> VtaResult<StoreKey>

Install one resolved artifact for the current platform, returning its store key. Fetch → verify → materialize → publish → commit a generation. A store hit short-circuits fetch/verify/materialize.

Source

pub fn install_artifact_reported( &self, tool: &str, version: &str, artifact: &Artifact, reporter: &dyn Reporter, ) -> VtaResult<StoreKey>

Like Engine::install_artifact, but drives reporter with download byte counts and phase transitions so a caller can render progress.

Source

pub fn bundle_current(&self, out: &Path) -> VtaResult<usize>

Bundle the active generation’s store entries into a portable archive (docs/13-offline.md). Returns the number of entries written.

Source

pub fn restore(&self, bundle: &Path) -> VtaResult<usize>

Restore store entries from a bundle, verifying each entry’s integrity against its content-addressed key. Returns the number newly imported.

Source

pub fn remove(&self, tool: &str) -> VtaResult<bool>

Remove a tool: record a new generation without it and unlink its primary executable. Returns whether the tool was present.

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<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> 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> 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 = 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<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