pub struct ClaudeCode<P: HubContext = NoParent> { /* private fields */ }Expand description
ClaudeCode activation - manages Claude Code sessions with Arbor-backed history
Generic over P: HubContext to allow different parent contexts:
Weak<DynamicHub>when registered with a DynamicHub- Custom context types for sub-hubs
NoParentfor standalone testing
Implementations§
Source§impl<P: HubContext> ClaudeCode<P>
impl<P: HubContext> ClaudeCode<P>
Sourcepub fn with_context_type(storage: Arc<ClaudeCodeStorage>) -> Self
pub fn with_context_type(storage: Arc<ClaudeCodeStorage>) -> Self
Create a new ClaudeCode with a specific parent context type
Sourcepub fn with_executor_and_context(
storage: Arc<ClaudeCodeStorage>,
executor: ClaudeCodeExecutor,
) -> Self
pub fn with_executor_and_context( storage: Arc<ClaudeCodeStorage>, executor: ClaudeCodeExecutor, ) -> Self
Create with custom executor and parent context type
Sourcepub fn inject_parent(&self, parent: P)
pub fn inject_parent(&self, parent: P)
Inject parent context for resolving foreign handles
Called during hub construction (e.g., via Arc::new_cyclic for DynamicHub). This allows ClaudeCode to resolve handles from other activations when walking arbor trees.
Sourcepub fn has_parent(&self) -> bool
pub fn has_parent(&self) -> bool
Check if parent context has been injected
Sourcepub fn parent(&self) -> Option<&P>
pub fn parent(&self) -> Option<&P>
Get a reference to the parent context
Returns None if inject_parent hasn’t been called yet.
Sourcepub async fn resolve_handle_impl(
&self,
handle: &Handle,
) -> Result<PlexusStream, PlexusError>
pub async fn resolve_handle_impl( &self, handle: &Handle, ) -> Result<PlexusStream, PlexusError>
Resolve a claudecode handle to its message content
Called by the macro-generated resolve_handle method. Handle format: {plugin_id}@1.0.0::chat:msg-{uuid}:{role}:{name}
Source§impl ClaudeCode<NoParent>
Convenience constructors for ClaudeCode with NoParent (standalone/testing)
impl ClaudeCode<NoParent>
Convenience constructors for ClaudeCode with NoParent (standalone/testing)
pub fn new(storage: Arc<ClaudeCodeStorage>) -> Self
pub fn with_executor( storage: Arc<ClaudeCodeStorage>, executor: ClaudeCodeExecutor, ) -> Self
Trait Implementations§
Source§impl<P: HubContext> Activation for ClaudeCode<P>
impl<P: HubContext> Activation for ClaudeCode<P>
type Methods = ClaudeCodeMethod
fn namespace(&self) -> &str
fn version(&self) -> &str
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn long_description(&self) -> Option<&str>
fn long_description(&self) -> Option<&str>
fn methods(&self) -> Vec<&str>
fn method_help(&self, method: &str) -> Option<String>
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn into_rpc_methods(self) -> Methods
Source§fn plugin_schema(&self) -> PluginSchema
fn plugin_schema(&self) -> PluginSchema
fn resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 Handle,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<P: Clone + HubContext> Clone for ClaudeCode<P>
impl<P: Clone + HubContext> Clone for ClaudeCode<P>
Source§fn clone(&self) -> ClaudeCode<P>
fn clone(&self) -> ClaudeCode<P>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<P> Freeze for ClaudeCode<P>
impl<P = NoParent> !RefUnwindSafe for ClaudeCode<P>
impl<P> Send for ClaudeCode<P>
impl<P> Sync for ClaudeCode<P>
impl<P> Unpin for ClaudeCode<P>where
P: Unpin,
impl<P> UnsafeUnpin for ClaudeCode<P>
impl<P = NoParent> !UnwindSafe for ClaudeCode<P>
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<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