pub struct EmbeddedSource { /* private fields */ }Expand description
A BundleSource that reads a bundle baked into the binary via
include_dir::Dir (WBSV-09), gated behind the embedded feature.
Downstream callers construct it from an include_dir! macro over a committed
bundle directory and wrap that static Dir:
ⓘ
use include_dir::{include_dir, Dir};
use pmcp_workbook_runtime::EmbeddedSource;
static BUNDLE: Dir = include_dir!("$CARGO_MANIFEST_DIR/bundle");
let source = EmbeddedSource::new(&BUNDLE);It returns the SAME bytes LocalDirSource does for the same member, so the
shared loader integrity-checks an embedded bundle identically to an on-disk
one.
Implementations§
Source§impl EmbeddedSource
impl EmbeddedSource
Sourcepub fn new(dir: &'static Dir<'static>) -> Self
pub fn new(dir: &'static Dir<'static>) -> Self
Wrap a 'static include_dir::Dir produced by the include_dir!
macro over a committed bundle directory.
Trait Implementations§
Source§impl BundleSource for EmbeddedSource
Available on crate feature embedded only.
impl BundleSource for EmbeddedSource
Available on crate feature
embedded only.Source§fn read_artifact(&self, name: &str) -> Result<Vec<u8>, BundleSourceError>
fn read_artifact(&self, name: &str) -> Result<Vec<u8>, BundleSourceError>
Return the EXACT bytes of the member named
name (a bundle-relative
path such as "manifest.json" or "evidence/changelog.json"). Read moreSource§fn list_artifacts(&self) -> Result<Vec<String>, BundleSourceError>
fn list_artifacts(&self) -> Result<Vec<String>, BundleSourceError>
Return the SORTED list of every member’s bundle-relative path
(including nested members like
"evidence/changelog.json"). Read moreSource§impl Clone for EmbeddedSource
impl Clone for EmbeddedSource
Source§fn clone(&self) -> EmbeddedSource
fn clone(&self) -> EmbeddedSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EmbeddedSource
impl RefUnwindSafe for EmbeddedSource
impl Send for EmbeddedSource
impl Sync for EmbeddedSource
impl Unpin for EmbeddedSource
impl UnsafeUnpin for EmbeddedSource
impl UnwindSafe for EmbeddedSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more