pub struct Context { /* private fields */ }
Expand description
The Context
is an object that can be shared across multiple processor runs
for any required shared state.
At the moment, it is used to provide a shared location on the local file system to store and retrieve data from.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Result<Self, ContextError>
pub fn new() -> Result<Self, ContextError>
Create a new Context
object.
§Errors
If the file system cannot be written to, or something else prevents the
temporary directory from being created, a ContextError
enum is
returned. Specifically the ContextError::Io
variant.
Sourcepub fn workspace_path(&self) -> &Path
pub fn workspace_path(&self) -> &Path
Returns a std::path::Path
reference to the shared workspace.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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