pub struct SessionSpawnOpts {
pub session_id: String,
pub sdk_url: String,
pub access_token: String,
pub use_ccr_v2: Option<bool>,
pub worker_epoch: Option<i64>,
pub on_first_user_message: Option<Box<dyn Fn(String) + Send + Sync>>,
}Expand description
Options for spawning a session
Fields§
§session_id: StringSession ID
sdk_url: StringSDK URL
access_token: StringAccess token
use_ccr_v2: Option<bool>When true, spawn the child with CCR v2 env vars (SSE transport + CCRClient).
worker_epoch: Option<i64>Required when useCcrV2 is true. Obtained from POST /worker/register.
on_first_user_message: Option<Box<dyn Fn(String) + Send + Sync>>Fires once with the text of the first real user message seen on the child’s stdout (via –replay-user-messages). Lets the caller derive a session title when none exists yet. Tool-result and synthetic user messages are skipped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionSpawnOpts
impl !RefUnwindSafe for SessionSpawnOpts
impl Send for SessionSpawnOpts
impl Sync for SessionSpawnOpts
impl Unpin for SessionSpawnOpts
impl UnsafeUnpin for SessionSpawnOpts
impl !UnwindSafe for SessionSpawnOpts
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