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<ProjectRef>
pub fn new( id: impl Into<String>, name: impl Into<String>, root: Option<PathBuf>, ) -> Option<ProjectRef>
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.
Trait Implementations§
Source§impl Clone for ProjectRef
impl Clone for ProjectRef
Source§fn clone(&self) -> ProjectRef
fn clone(&self) -> ProjectRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectRef
impl Debug for ProjectRef
impl Eq for ProjectRef
Source§impl PartialEq for ProjectRef
impl PartialEq for ProjectRef
impl StructuralPartialEq for ProjectRef
Auto Trait Implementations§
impl Forget for ProjectRef
impl Freeze for ProjectRef
impl Move for ProjectRef
impl RefUnwindSafe for ProjectRef
impl Send for ProjectRefwhere
RawVecInner: Send,
impl Sync for ProjectRefwhere
RawVecInner: Sync,
impl Unpin for ProjectRef
impl UnsafeUnpin for ProjectRef
impl UnwindSafe for ProjectRefwhere
RawVecInner: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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