pub struct LoopbackStorage { /* private fields */ }Implementations§
Source§impl LoopbackStorage
impl LoopbackStorage
pub async fn new(config: LoopbackStorageConfig) -> Result<Self, String>
Sourcepub fn register_tool_session(&self, tool_use_id: &str, session_id: &str)
pub fn register_tool_session(&self, tool_use_id: &str, session_id: &str)
Register a tool_use_id -> session_id mapping Called by the background task when it sees a ToolUse event
Sourcepub fn lookup_session_by_tool(&self, tool_use_id: &str) -> Option<String>
pub fn lookup_session_by_tool(&self, tool_use_id: &str) -> Option<String>
Lookup session_id by tool_use_id Called by loopback_permit to find the correct session_id
Sourcepub fn remove_tool_mapping(&self, tool_use_id: &str)
pub fn remove_tool_mapping(&self, tool_use_id: &str)
Remove a tool_use_id mapping (called after approval is resolved)
pub async fn create_approval( &self, session_id: &str, tool_name: &str, tool_use_id: &str, input: &Value, ) -> Result<ApprovalRequest, String>
pub async fn get_approval( &self, id: &ApprovalId, ) -> Result<ApprovalRequest, String>
pub async fn resolve_approval( &self, id: &ApprovalId, approved: bool, message: Option<String>, ) -> Result<(), String>
pub async fn list_pending( &self, session_id: Option<&str>, ) -> Result<Vec<ApprovalRequest>, String>
Auto Trait Implementations§
impl !Freeze for LoopbackStorage
impl !RefUnwindSafe for LoopbackStorage
impl Send for LoopbackStorage
impl Sync for LoopbackStorage
impl Unpin for LoopbackStorage
impl UnsafeUnpin for LoopbackStorage
impl !UnwindSafe for LoopbackStorage
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