pub struct EmbeddedSource { /* private fields */ }Expand description
The binary-baked workbook BundleSource (WBSV-09), re-exported at the
crate root only when the workbook-embedded feature is active.
The binary-baked BundleSource (WBSV-09), re-exported only when the
toolkit’s workbook-embedded feature layers the runtime’s embedded
(include_dir) support on top of the LocalDirSource-only workbook build.
To construct one, invoke the include_dir::include_dir! macro over a
committed bundle directory (add include_dir as a dependency — the macro
emits unqualified include_dir:: paths so the crate must be nameable at the
consumer’s root) and pass the resulting &'static Dir to
EmbeddedSource::new.
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>) -> EmbeddedSource
pub fn new(dir: &'static Dir<'static>) -> EmbeddedSource
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
embedded only.Source§fn read_artifact(&self, name: &str) -> Result<Vec<u8>, BundleSourceError>
fn read_artifact(&self, name: &str) -> Result<Vec<u8>, BundleSourceError>
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>
"evidence/changelog.json"). Read moreSource§impl Clone for EmbeddedSource
impl Clone for EmbeddedSource
Source§fn clone(&self) -> EmbeddedSource
fn clone(&self) -> EmbeddedSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more