pub struct ProjectRef {
pub id: String,
pub name: String,
pub root: Option<PathBuf>,
}Expand description
The project a turn works in: a unit of work the host keeps (an app’s
project, a bot placed in one), with the folder it lives in when it has
one. Memory and tools key project-scoped state on ProjectRef::id,
which stays the same when the project is renamed or its folder moves.
The host resolves it from its own typed state (which project a conversation is placed in, which folder a turn is bound to), never from what a message says.
Fields§
§id: StringStable id. Only ASCII letters, digits, - and _ (see
ProjectRef::is_valid_id), so it is safe as a directory name.
name: StringThe name the owner gave it.
root: Option<PathBuf>The folder, absolute, when the project has one.
Implementations§
Source§impl ProjectRef
impl ProjectRef
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
root: Option<PathBuf>,
) -> Option<Self>
pub fn new( id: impl Into<String>, name: impl Into<String>, root: Option<PathBuf>, ) -> Option<Self>
A project, when id is a valid project id.
Sourcepub fn is_valid_id(id: &str) -> bool
pub fn is_valid_id(id: &str) -> bool
1–128 ASCII letters, digits, - or _, not starting with -: a
name that cannot leave the directory it is joined to.