pub struct AppContext<'a> {
pub fs: &'a dyn Filesystem,
pub git: &'a dyn GitClient,
pub clock: &'a dyn Clock,
pub paths: &'a ConfigPaths,
pub llm: Option<&'a dyn LlmClient>,
}Expand description
Bundles all I/O gateway dependencies for a command invocation.
Production code constructs one AppContext in main with real
implementations and passes it down. Tests construct it with fakes.
Fields§
§fs: &'a dyn Filesystem§git: &'a dyn GitClient§clock: &'a dyn Clock§paths: &'a ConfigPaths§llm: Option<&'a dyn LlmClient>Implementations§
Source§impl<'a> AppContext<'a>
impl<'a> AppContext<'a>
Sourcepub fn with_paths<'b>(&self, paths: &'b ConfigPaths) -> AppContext<'b>where
'a: 'b,
pub fn with_paths<'b>(&self, paths: &'b ConfigPaths) -> AppContext<'b>where
'a: 'b,
Return a copy of this context with paths replaced.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AppContext<'a>
impl<'a> !Send for AppContext<'a>
impl<'a> !Sync for AppContext<'a>
impl<'a> !UnwindSafe for AppContext<'a>
impl<'a> Freeze for AppContext<'a>
impl<'a> Unpin for AppContext<'a>
impl<'a> UnsafeUnpin for AppContext<'a>
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