pub struct WorkspaceBuilder { /* private fields */ }Expand description
Builder for constructing a Workspace with fluent configuration.
§Example
use adk_code::Workspace;
let workspace = Workspace::new("./app")
.project_name("my-app")
.session_id("session-42")
.created_at(1719000000)
.build();
assert_eq!(workspace.metadata().project_name, "my-app");
assert_eq!(workspace.metadata().created_at, Some(1719000000));Implementations§
Source§impl WorkspaceBuilder
impl WorkspaceBuilder
Sourcepub fn project_name(self, name: impl Into<String>) -> Self
pub fn project_name(self, name: impl Into<String>) -> Self
Set the project name.
If not set, defaults to the root directory’s file name or "unnamed".
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Set the session ID for execution correlation.
Sourcepub fn created_at(self, timestamp: u64) -> Self
pub fn created_at(self, timestamp: u64) -> Self
Set the workspace creation timestamp (Unix epoch seconds).
Sourcepub fn channel_capacity(self, capacity: usize) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
Set the broadcast channel capacity for collaboration events.
Defaults to 256. Larger values retain more event history at the cost of memory. Events beyond the capacity are dropped for slow subscribers.
Trait Implementations§
Source§impl Clone for WorkspaceBuilder
impl Clone for WorkspaceBuilder
Source§fn clone(&self) -> WorkspaceBuilder
fn clone(&self) -> WorkspaceBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkspaceBuilder
impl RefUnwindSafe for WorkspaceBuilder
impl Send for WorkspaceBuilder
impl Sync for WorkspaceBuilder
impl Unpin for WorkspaceBuilder
impl UnsafeUnpin for WorkspaceBuilder
impl UnwindSafe for WorkspaceBuilder
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