pub struct Memory { /* private fields */ }Expand description
A host whose inputs are named byte strings and whose outputs stay in memory: what the bindings give the surface (spec 027, 3.1.3), where a command’s artifacts are returned as bytes rather than written to files. It has no aggregate read budget; each read is bounded by its maximum.
Implementations§
Trait Implementations§
Source§impl Host for Memory
impl Host for Memory
Source§fn read_classified(
&self,
label: &str,
max: usize,
) -> Result<Option<Vec<u8>>, ReadFail>
fn read_classified( &self, label: &str, max: usize, ) -> Result<Option<Vec<u8>>, ReadFail>
Read
label, at most max bytes of it; None when it does not
exist. A failure of the input is told from an exhausted command
budget, which depends on read order rather than on the input.Source§fn ensure_absent(&self, label: &str) -> Result<(), IoFail>
fn ensure_absent(&self, label: &str) -> Result<(), IoFail>
Refuse an output that already exists, before any work. A pure check
that changes nothing, so calling it again for the same label gives
the same answer: commands check every output up front and again
just before writing.
Source§fn create(&self, label: &str, bytes: &[u8]) -> Result<(), IoFail>
fn create(&self, label: &str, bytes: &[u8]) -> Result<(), IoFail>
Publish one output, never overwriting.
Source§fn write_all(&self, files: &[(String, Vec<u8>)]) -> Result<(), IoFail>
fn write_all(&self, files: &[(String, Vec<u8>)]) -> Result<(), IoFail>
Publish every
(label, bytes), all or none.Source§fn join(&self, dir: &str, name: &str) -> String
fn join(&self, dir: &str, name: &str) -> String
The label of
name inside the output or input directory dir.Auto Trait Implementations§
impl !Freeze for Memory
impl !RefUnwindSafe for Memory
impl !Sync for Memory
impl Send for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memory
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