pub struct ProjectView {
pub key: ProjectKey,
pub name: String,
pub org: String,
pub path: PathBuf,
pub display_path: String,
pub accounts: Vec<String>,
pub fallback_accounts: Vec<String>,
pub has_model: bool,
pub sessions: Vec<SessionView>,
}Expand description
One project from the catalog plus its sessions, sorted last-
activity descending. sessions[0] is the lead. Empty sessions
means the project has no on-disk history yet.
Fields§
§key: ProjectKey§name: StringThe toml name field from forge.toml. Distinct from key,
which is the canonicalised on-disk project key derived from
the project’s path. Callers wanting to address a project via
crate::SessionTarget::Named use this value; callers
keying a HashMap of in-process Agent handles use Self::key.
org: StringName of the org this project belongs to (from
[[orgs]].name in forge.toml). Drives the org-grouping
in the Projects pane tree render.
path: PathBufFilesystem-resolved project root (~ expanded). This is the
path callers should hand to filesystem APIs - cwd_raw for
the spawning bucket, file_index::restart, the git-context
watcher, etc. Use Self::display_path for human-readable
rendering instead.
display_path: StringHuman-readable rendering of the project’s root path (e.g.
~/Projects/forge, with ~ left in place rather than
expanded). Display-only - not a path you can open().
accounts: Vec<String>Account display_names this project may spawn under, inherited
from the project’s [[orgs]] entry. Non-empty (the config
loader enforces).
fallback_accounts: Vec<String>Fallback display_names inherited from the project’s [[orgs]]
entry, alongside accounts. Empty when the org names none.
has_model: booltrue when the project declares model. A spawn under a
project without one is refused, so the launchpad’s row needs to
tell the two reasons no spawn can run apart: no model to match
on, or no account that could serve it.
sessions: Vec<SessionView>Implementations§
Source§impl ProjectView
impl ProjectView
Sourcepub fn new_for_test(
key: ProjectKey,
name: impl Into<String>,
display_path: impl Into<String>,
sessions: Vec<SessionView>,
) -> Self
pub fn new_for_test( key: ProjectKey, name: impl Into<String>, display_path: impl Into<String>, sessions: Vec<SessionView>, ) -> Self
Test-only constructor for cross-crate fixtures (a view’s
Projects pane snapshot tests). Behind the test-helpers
Cargo feature to keep test-only construction out of the
production API.
Sourcepub fn new_for_test_with_org(
key: ProjectKey,
name: impl Into<String>,
display_path: impl Into<String>,
org: impl Into<String>,
accounts: Vec<String>,
fallback_accounts: Vec<String>,
sessions: Vec<SessionView>,
) -> Self
pub fn new_for_test_with_org( key: ProjectKey, name: impl Into<String>, display_path: impl Into<String>, org: impl Into<String>, accounts: Vec<String>, fallback_accounts: Vec<String>, sessions: Vec<SessionView>, ) -> Self
Variant of Self::new_for_test that lets the fixture
supply an org + accounts list.
Trait Implementations§
Source§impl Clone for ProjectView
impl Clone for ProjectView
Source§impl Debug for ProjectView
impl Debug for ProjectView
Source§impl<'de> Deserialize<'de> for ProjectView
impl<'de> Deserialize<'de> for ProjectView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProjectView
impl RefUnwindSafe for ProjectView
impl Send for ProjectView
impl Sync for ProjectView
impl Unpin for ProjectView
impl UnsafeUnpin for ProjectView
impl UnwindSafe for ProjectView
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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