pub struct AgentsCatalogState {
pub dir: PathBuf,
pub tier: &'static str,
}Expand description
Shared, immutable state every agents.* handler in this module closes
over: the resolved disk agents directory and its tier label for this
daemon instance.
Why: dir/tier are fixed for the daemon’s entire lifetime (derived
once from ProjectBinding at startup, see crate::serve::build_router_at)
— no shared mutable state, no Mutex, unlike WorkstreamStore.
What: dir is ProjectBinding::agents_dir()’s result; tier is
"project" when a project is bound, "user" when projectless.
Fields§
§dir: PathBufThe resolved disk agents directory (project- or user-scoped).
tier: &'static str"project" or "user" — which tier dir represents.
Implementations§
Source§impl AgentsCatalogState
impl AgentsCatalogState
Sourcepub fn new(dir: PathBuf, project_bound: bool) -> Self
pub fn new(dir: PathBuf, project_bound: bool) -> Self
Build state from a resolved agents directory and whether a project is bound.
Why: keeps the “project bound -> tier project, else user” rule in one
place rather than re-deriving it at every call site that constructs
this state (today: crate::serve::build_router_at).
What: tier = "project" when project_bound, else "user".
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentsCatalogState
impl RefUnwindSafe for AgentsCatalogState
impl Send for AgentsCatalogState
impl Sync for AgentsCatalogState
impl Unpin for AgentsCatalogState
impl UnsafeUnpin for AgentsCatalogState
impl UnwindSafe for AgentsCatalogState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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