Skip to main content

BundleBuilder

Struct BundleBuilder 

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

Assembles a bundle.

Implementations§

Source§

impl BundleBuilder

Source

pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self

New bundle named name at version.

Source

pub fn description(self, description: impl Into<String>) -> Self

Source

pub fn created_at(self, created_at: impl Into<String>) -> Self

Fixed creation time (RFC 3339) for reproducible builds. Defaults to $SOURCE_DATE_EPOCH when set, else the current time.

Source

pub fn workflow( self, path: &str, text: impl Into<String>, ) -> Result<Self, BundleError>

Add a workflow document stored at path (e.g. workflow.yaml). The first workflow added is the entry. The document must parse.

Source

pub fn file(self, path: &str, bytes: Vec<u8>) -> Result<Self, BundleError>

Add an arbitrary file (assets, data) at path.

Source

pub fn include_dir(self, dir: &Path, prefix: &str) -> Result<Self, BundleError>

Copy a directory under prefix/ (e.g. assets), skipping build output and VCS folders.

Source

pub fn plugin_dir(self, dir: &Path) -> Result<Self, BundleError>

Add a plugin directory (with graphrt-plugin.json or .yaml) under plugins/<name>/. The manifest is stored as JSON. WebAssembly plugins are portable; process and http plugins are kept but flagged non-portable.

Source

pub fn wasm_module( self, name: &str, module: Vec<u8>, ) -> Result<Self, BundleError>

Add a bare, self-describing WebAssembly module as plugin name (a manifest is generated; its node kinds may be plain names).

Source

pub fn providers(self, text: &str) -> Result<Self, BundleError>

Add a model providers file (YAML or JSON). Files with inline secrets are rejected.

Source

pub fn knowledge(self, text: &str, base_dir: &Path) -> Result<Self, BundleError>

Add a knowledge-base config (YAML or JSON). Stores whose path exists under base_dir (memory JSON files, SQLite databases) are copied into knowledge/ and the path rewritten, so a prebuilt index ships with the bundle. Inline secrets are rejected, and so is a SQLite database whose write-ahead log still holds commits (the copy would silently miss them).

Source

pub fn build(self) -> Result<Vec<u8>, BundleError>

Finish: compute requirements and hashes and produce the archive bytes.

Trait Implementations§

Source§

impl Clone for BundleBuilder

Source§

fn clone(&self) -> Self

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 BundleBuilder

Source§

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

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

impl Default for BundleBuilder

Source§

fn default() -> Self

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

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.