Skip to main content

ContextManager

Struct ContextManager 

Source
pub struct ContextManager { /* private fields */ }

Implementations§

Source§

impl ContextManager

Source

pub fn new() -> Self

Source

pub fn with_generator( generator_fn: impl Fn(&str, &str) -> Result<String, String> + Send + Sync + 'static, ) -> Self

Source

pub fn drain(&mut self)

Drain completed context results from background threads.

Source

pub fn get(&self, name: &str) -> Option<&str>

Get the context for a window, if available.

Source

pub fn get_error(&self, name: &str) -> Option<&str>

Get the last error for a window, if generation failed.

Source

pub fn is_loading(&self, name: &str) -> bool

Whether a context request is currently running for this window.

Source

pub fn tick( &mut self, windows: &[WindowInfo], states: &HashMap<u32, WindowState>, selected: usize, pane_id_for: &impl Fn(u32) -> Option<String>, cwd_for: &impl Fn(u32) -> Option<String>, )

Run one tick of context orchestration.

  • Drains completed results from background threads
  • Invalidates cache on state transitions (Working → settled)
  • Requests context for the selected window (lazy — only when settled)
  • On selection change: refreshes old session (if settled), requests new session
Source

pub fn request(&mut self, name: &str, cwd: &str, pane_id: &str)

Request context generation for a window (no-op if cached, in flight, or within retry cooldown).

Source

pub fn refresh(&mut self, name: &str, cwd: &str, pane_id: &str)

Force-refresh context for a window (clears cache/failed/errors, respects in_flight).

Trait Implementations§

Source§

impl Default for ContextManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.