pub struct Ap2Protocol { /* private fields */ }Expand description
AP2 Protocol Handler
Implementations§
Source§impl Ap2Protocol
impl Ap2Protocol
pub fn new() -> Self
Sourcepub fn register_agent(
&mut self,
agent_id: &str,
public_key: Vec<u8>,
) -> Result<AgentIdentity>
pub fn register_agent( &mut self, agent_id: &str, public_key: Vec<u8>, ) -> Result<AgentIdentity>
Register a new agent identity
Sourcepub fn create_intent_mandate(
&self,
issuer: &AgentIdentity,
subject_agent: &str,
intent_description: &str,
private_key: &[u8],
) -> Result<VerifiableCredential>
pub fn create_intent_mandate( &self, issuer: &AgentIdentity, subject_agent: &str, intent_description: &str, private_key: &[u8], ) -> Result<VerifiableCredential>
Create an intent mandate (user authorizes agent action)
Sourcepub fn create_cart_mandate(
&self,
issuer: &AgentIdentity,
items: Vec<CartItem>,
total_amount: u64,
currency: &str,
private_key: &[u8],
) -> Result<VerifiableCredential>
pub fn create_cart_mandate( &self, issuer: &AgentIdentity, items: Vec<CartItem>, total_amount: u64, currency: &str, private_key: &[u8], ) -> Result<VerifiableCredential>
Create a cart mandate (explicit purchase authorization)
Sourcepub fn create_payment_mandate(
&self,
issuer: &AgentIdentity,
recipient: &str,
amount: u64,
currency: &str,
payment_method: &str,
private_key: &[u8],
) -> Result<VerifiableCredential>
pub fn create_payment_mandate( &self, issuer: &AgentIdentity, recipient: &str, amount: u64, currency: &str, payment_method: &str, private_key: &[u8], ) -> Result<VerifiableCredential>
Create a payment mandate (payment network signal)
Verify a complete payment authorization with multi-agent consensus
Sourcepub fn resolve_did(&self, did: &str) -> Result<DidDocument>
pub fn resolve_did(&self, did: &str) -> Result<DidDocument>
Resolve a DID to its document
Sourcepub fn did_resolver(&self) -> &DidResolver
pub fn did_resolver(&self) -> &DidResolver
Get DID resolver reference
Sourcepub fn did_manager(&self) -> &DidManager
pub fn did_manager(&self) -> &DidManager
Get DID manager reference
Trait Implementations§
Source§impl Debug for Ap2Protocol
impl Debug for Ap2Protocol
Auto Trait Implementations§
impl !Freeze for Ap2Protocol
impl !RefUnwindSafe for Ap2Protocol
impl Send for Ap2Protocol
impl Sync for Ap2Protocol
impl Unpin for Ap2Protocol
impl !UnwindSafe for Ap2Protocol
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