pub struct Bundle { /* private fields */ }Expand description
A bundle the host serves.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn embedded(
files: &'static [(&'static str, &'static [u8])],
) -> Result<Self, BundleError>
pub fn embedded( files: &'static [(&'static str, &'static [u8])], ) -> Result<Self, BundleError>
The bundle embedded in a binary: its files by path, sorted, manifest.json among them.
§Errors
BundleError when it has no manifest, or one that can’t be used.
Sourcepub fn read(folder: &Path) -> Result<Self, BundleError>
pub fn read(folder: &Path) -> Result<Self, BundleError>
Sourcepub fn from_files<P: Into<String>>(
files: impl IntoIterator<Item = (P, Vec<u8>)>,
) -> Result<Self, BundleError>
pub fn from_files<P: Into<String>>( files: impl IntoIterator<Item = (P, Vec<u8>)>, ) -> Result<Self, BundleError>
A bundle of files, by path, manifest.json among them: for a host’s tests.
§Errors
BundleError when it has no manifest, or one that can’t be used.
Sourcepub fn frame_file(&self, path: &FilePath) -> Option<Vec<u8>>
pub fn frame_file(&self, path: &FilePath) -> Option<Vec<u8>>
The bytes of the frames’ file at path, inside frames/<hash>/.
Sourcepub fn pack_file(&self, place: &Place) -> Option<Vec<u8>>
pub fn pack_file(&self, place: &Place) -> Option<Vec<u8>>
The bytes of the pack file at place, packs/<place>, when the bundle holds that release.
Sourcepub fn frames_base(&self, origin: &str) -> String
pub fn frames_base(&self, origin: &str) -> String
The frames’ base on origin (compmd://localhost, https://frames.example), as @compmd/sandbox takes it.
Trait Implementations§
impl StructuralPartialEq for Bundle
Auto Trait Implementations§
impl Forget for Bundle
impl Freeze for Bundle
impl Move for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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