pub struct HttpAsyncWitnessClient { /* private fields */ }Expand description
HTTP-based witness client implementing AsyncWitnessProvider.
Communicates with a KERI witness server over HTTP to submit events, retrieve receipts, and check identity heads.
Usage:
ⓘ
use auths_infra_http::HttpAsyncWitnessClient;
let client = HttpAsyncWitnessClient::new("http://localhost:3000", 2)
.with_timeout(std::time::Duration::from_secs(10));Implementations§
Source§impl HttpAsyncWitnessClient
impl HttpAsyncWitnessClient
Sourcepub fn new(base_url: impl Into<String>, quorum_size: usize) -> Self
pub fn new(base_url: impl Into<String>, quorum_size: usize) -> Self
Creates a new HTTP async witness client.
Args:
base_url: The witness server base URL (e.g.,"http://localhost:3000").quorum_size: Minimum receipts required for this witness.
Usage:
ⓘ
let client = HttpAsyncWitnessClient::new("http://witness:3000", 1);Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets a custom timeout for HTTP requests.
Args:
timeout: The request timeout duration.
Usage:
ⓘ
let client = HttpAsyncWitnessClient::new("http://witness:3000", 1)
.with_timeout(Duration::from_secs(30));Trait Implementations§
Source§impl AsyncWitnessProvider for HttpAsyncWitnessClient
impl AsyncWitnessProvider for HttpAsyncWitnessClient
Source§fn submit_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
event_json: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Receipt, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn submit_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
event_json: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<Receipt, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Submit an event to the witness for receipting. Read more
Source§fn observe_identity_head<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
) -> Pin<Box<dyn Future<Output = Result<Option<EventHash>, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn observe_identity_head<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
) -> Pin<Box<dyn Future<Output = Result<Option<EventHash>, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query the current observed head for an identity. Read more
Source§fn get_receipt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
event_said: &'life2 Said,
) -> Pin<Box<dyn Future<Output = Result<Option<Receipt>, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_receipt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 Prefix,
event_said: &'life2 Said,
) -> Pin<Box<dyn Future<Output = Result<Option<Receipt>, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve a previously issued receipt. Read more
Source§fn timeout_ms(&self) -> u64
fn timeout_ms(&self) -> u64
Get the timeout for operations in milliseconds. Read more
Source§impl Clone for HttpAsyncWitnessClient
impl Clone for HttpAsyncWitnessClient
Source§fn clone(&self) -> HttpAsyncWitnessClient
fn clone(&self) -> HttpAsyncWitnessClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpAsyncWitnessClient
impl !RefUnwindSafe for HttpAsyncWitnessClient
impl Send for HttpAsyncWitnessClient
impl Sync for HttpAsyncWitnessClient
impl Unpin for HttpAsyncWitnessClient
impl UnsafeUnpin for HttpAsyncWitnessClient
impl !UnwindSafe for HttpAsyncWitnessClient
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