pub struct DeltaToolHandler { /* private fields */ }Expand description
Protocol Delta tool handler (uses ProofLedger)
Implementations§
Source§impl DeltaToolHandler
impl DeltaToolHandler
Sourcepub fn new<P: AsRef<Path>>(ledger_path: P) -> Result<Self, ProofLedgerError>
pub fn new<P: AsRef<Path>>(ledger_path: P) -> Result<Self, ProofLedgerError>
Create a new Protocol Delta tool handler
§Arguments
ledger_path- Path to the SQLite ledger database
Sourcepub fn in_memory() -> Result<Self, ProofLedgerError>
pub fn in_memory() -> Result<Self, ProofLedgerError>
Create an in-memory handler (for testing)
Sourcepub fn tool_definitions() -> Vec<Tool>
pub fn tool_definitions() -> Vec<Tool>
Get tool definitions for MCP registration
Sourcepub async fn handle_anchor(
&self,
args: &HashMap<String, Value>,
) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_anchor( &self, args: &HashMap<String, Value>, ) -> Result<ToolResult, ProofLedgerError>
Handle a delta_anchor tool call
Sourcepub async fn handle_verify(
&self,
args: &HashMap<String, Value>,
) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_verify( &self, args: &HashMap<String, Value>, ) -> Result<ToolResult, ProofLedgerError>
Handle a delta_verify tool call
Sourcepub async fn handle_lookup(
&self,
args: &HashMap<String, Value>,
) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_lookup( &self, args: &HashMap<String, Value>, ) -> Result<ToolResult, ProofLedgerError>
Handle a delta_lookup tool call
Sourcepub async fn handle_list_by_url(
&self,
args: &HashMap<String, Value>,
) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_list_by_url( &self, args: &HashMap<String, Value>, ) -> Result<ToolResult, ProofLedgerError>
Handle a delta_list_by_url tool call
Sourcepub async fn handle_stats(&self) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_stats(&self) -> Result<ToolResult, ProofLedgerError>
Handle a delta_stats tool call
Sourcepub async fn handle_tool(
&self,
name: &str,
args: &HashMap<String, Value>,
) -> Result<ToolResult, ProofLedgerError>
pub async fn handle_tool( &self, name: &str, args: &HashMap<String, Value>, ) -> Result<ToolResult, ProofLedgerError>
Dispatch a tool call to the appropriate handler
Auto Trait Implementations§
impl Freeze for DeltaToolHandler
impl !RefUnwindSafe for DeltaToolHandler
impl !Send for DeltaToolHandler
impl !Sync for DeltaToolHandler
impl Unpin for DeltaToolHandler
impl !UnwindSafe for DeltaToolHandler
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