pub struct Workspace {
pub id: String,
pub name: String,
pub root: PathBuf,
pub metadata: HashMap<String, String>,
pub context: HashMap<String, Value>,
}Expand description
A workspace for an agent session
Fields§
§id: StringWorkspace ID
name: StringWorkspace name
root: PathBufRoot directory path
metadata: HashMap<String, String>Workspace metadata
context: HashMap<String, Value>Context data
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
root: PathBuf,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, root: PathBuf, ) -> Self
Create a new workspace
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Set metadata
Sourcepub fn with_context(self, key: impl Into<String>, value: Value) -> Self
pub fn with_context(self, key: impl Into<String>, value: Value) -> Self
Set context data
Sourcepub fn get_context(&self, key: &str) -> Option<&Value>
pub fn get_context(&self, key: &str) -> Option<&Value>
Get context value
Sourcepub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata(&self, key: &str) -> Option<&String>
Get metadata value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workspace
impl<'de> Deserialize<'de> for Workspace
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnwindSafe for Workspace
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
Mutably borrows from an owned value. Read more