pub struct ContextManager { /* private fields */ }Expand description
Manages persistent focus context state.
State is stored in .mdvault/state/context.toml within the vault.
Implementations§
Source§impl ContextManager
impl ContextManager
Sourcepub fn load(vault_root: &Path) -> Result<Self, ContextError>
pub fn load(vault_root: &Path) -> Result<Self, ContextError>
Load context manager for a vault.
Creates the state file if it doesn’t exist.
Sourcepub fn set_focus(&mut self, project: &str) -> Result<(), ContextError>
pub fn set_focus(&mut self, project: &str) -> Result<(), ContextError>
Set focus to a project.
Replaces any existing focus.
Sourcepub fn set_focus_with_note(
&mut self,
project: &str,
note: &str,
) -> Result<(), ContextError>
pub fn set_focus_with_note( &mut self, project: &str, note: &str, ) -> Result<(), ContextError>
Set focus with an optional note.
Sourcepub fn clear_focus(&mut self) -> Result<(), ContextError>
pub fn clear_focus(&mut self) -> Result<(), ContextError>
Clear the current focus.
Sourcepub fn active_project(&self) -> Option<&str>
pub fn active_project(&self) -> Option<&str>
Get the active project ID, if any.
Sourcepub fn focus(&self) -> Option<&FocusContext>
pub fn focus(&self) -> Option<&FocusContext>
Get the full focus context, if any.
Sourcepub fn state(&self) -> &ContextState
pub fn state(&self) -> &ContextState
Get the current state (for serialization to MCP).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextManager
impl RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnwindSafe for ContextManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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