pub struct ExtensionContextBuilder { /* private fields */ }Expand description
Builder for ExtensionContext.
Implementations§
Source§impl ExtensionContextBuilder
impl ExtensionContextBuilder
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Set the session ID.
Sourcepub fn tool_registrar(
self,
registrar: Arc<dyn Fn(Arc<dyn AgentTool>) + Send + Sync>,
) -> Self
pub fn tool_registrar( self, registrar: Arc<dyn Fn(Arc<dyn AgentTool>) + Send + Sync>, ) -> Self
Set the tool registrar callback.
Sourcepub fn message_sender(self, sender: Arc<dyn Fn(&str) + Send + Sync>) -> Self
pub fn message_sender(self, sender: Arc<dyn Fn(&str) + Send + Sync>) -> Self
Set the message sender callback.
Sourcepub fn errors(self, errors: Arc<RwLock<Vec<ExtensionErrorRecord>>>) -> Self
pub fn errors(self, errors: Arc<RwLock<Vec<ExtensionErrorRecord>>>) -> Self
Set the shared error buffer.
Sourcepub fn build(self) -> ExtensionContext
pub fn build(self) -> ExtensionContext
Build the context, falling back to no-op callbacks where necessary.
Auto Trait Implementations§
impl Freeze for ExtensionContextBuilder
impl !RefUnwindSafe for ExtensionContextBuilder
impl Send for ExtensionContextBuilder
impl Sync for ExtensionContextBuilder
impl Unpin for ExtensionContextBuilder
impl UnsafeUnpin for ExtensionContextBuilder
impl !UnwindSafe for ExtensionContextBuilder
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
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>
Converts
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>
Converts
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