pub struct Context { /* private fields */ }
Expand description
Context for a single reproto run.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(filesystem: Box<dyn Filesystem>) -> Context
pub fn new(filesystem: Box<dyn Filesystem>) -> Context
Create a new context with the given filesystem.
Sourcepub fn with_items(self, items: Rc<RefCell<Vec<ContextItem>>>) -> Context
pub fn with_items(self, items: Rc<RefCell<Vec<ContextItem>>>) -> Context
Modify the existing context with a reference to the given errors.
Sourcepub fn map_filesystem<F>(self, map: F) -> Self
pub fn map_filesystem<F>(self, map: F) -> Self
Map the existing filesystem and return a new context with the new filesystem.
Sourcepub fn filesystem(&self, root: Option<&Path>) -> Result<Box<dyn Handle>>
pub fn filesystem(&self, root: Option<&Path>) -> Result<Box<dyn Handle>>
Retrieve the filesystem abstraction.
Sourcepub fn diagnostics(&self, diagnostics: Diagnostics) -> Result<()>
pub fn diagnostics(&self, diagnostics: Diagnostics) -> Result<()>
Add the given diagnostics to this context.
Sourcepub fn items(&self) -> Result<Ref<'_, Vec<ContextItem>>, BorrowError>
pub fn items(&self) -> Result<Ref<'_, Vec<ContextItem>>, BorrowError>
Iterate over all reporter items.
Sourcepub fn has_diagnostics(&self) -> Result<bool>
pub fn has_diagnostics(&self) -> Result<bool>
Check if reporter is empty.
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