pub struct AveApi { /* private fields */ }Implementations§
Source§impl Api
impl Api
Sourcepub async fn build(
keys: KeyPair,
config: Config,
sink_auth: SinkAuth,
registry: &mut Registry,
password: &str,
graceful_token: CancellationToken,
crash_token: CancellationToken,
) -> Result<(Api, Vec<JoinHandle<()>>), Error>
pub async fn build( keys: KeyPair, config: Config, sink_auth: SinkAuth, registry: &mut Registry, password: &str, graceful_token: CancellationToken, crash_token: CancellationToken, ) -> Result<(Api, Vec<JoinHandle<()>>), Error>
Creates a new Api.
pub fn peer_id(&self) -> &str
pub fn public_key(&self) -> &str
pub async fn get_network_state(&self) -> Result<MonitorNetworkState, Error>
pub async fn get_requests_in_manager(&self) -> Result<RequestsInManager, Error>
pub async fn get_requests_in_manager_subject_id( &self, subject_id: DigestIdentifier, ) -> Result<RequestsInManagerSubject, Error>
pub async fn external_request( &self, request: Signed<EventRequest>, ) -> Result<RequestData, Error>
pub async fn own_request( &self, request: EventRequest, ) -> Result<RequestData, Error>
pub async fn get_approval( &self, subject_id: DigestIdentifier, state: Option<ApprovalState>, ) -> Result<Option<(ApprovalReq, ApprovalState)>, Error>
pub async fn get_approvals( &self, state: Option<ApprovalState>, ) -> Result<Vec<(ApprovalReq, ApprovalState)>, Error>
pub async fn approve( &self, subject_id: DigestIdentifier, state: ApprovalStateRes, ) -> Result<String, Error>
pub async fn manual_request_abort( &self, subject_id: DigestIdentifier, ) -> Result<String, Error>
pub async fn get_request_state( &self, request_id: DigestIdentifier, ) -> Result<RequestInfo, Error>
pub async fn all_request_state(&self) -> Result<Vec<RequestInfoExtend>, Error>
pub async fn get_pending_transfers(&self) -> Result<Vec<TransferSubject>, Error>
pub async fn auth_subject( &self, subject_id: DigestIdentifier, witnesses: AuthWitness, ) -> Result<String, Error>
pub async fn all_auth_subjects(&self) -> Result<Vec<DigestIdentifier>, Error>
pub async fn witnesses_subject( &self, subject_id: DigestIdentifier, ) -> Result<HashSet<PublicKey>, Error>
pub async fn delete_auth_subject( &self, subject_id: DigestIdentifier, ) -> Result<String, Error>
pub async fn update_subject( &self, subject_id: DigestIdentifier, ) -> Result<String, Error>
pub async fn manual_distribution( &self, subject_id: DigestIdentifier, ) -> Result<String, Error>
pub async fn all_govs( &self, active: Option<bool>, ) -> Result<Vec<GovsData>, Error>
pub async fn all_subjs( &self, governance_id: DigestIdentifier, active: Option<bool>, schema_id: Option<String>, ) -> Result<Vec<SubjsData>, Error>
pub async fn get_events( &self, subject_id: DigestIdentifier, query: EventsQuery, ) -> Result<PaginatorEvents, Error>
pub async fn get_aborts( &self, subject_id: DigestIdentifier, query: AbortsQuery, ) -> Result<PaginatorAborts, Error>
pub async fn get_event_sn( &self, subject_id: DigestIdentifier, sn: u64, ) -> Result<LedgerDB, Error>
pub async fn get_first_or_end_events( &self, subject_id: DigestIdentifier, quantity: Option<u64>, reverse: Option<bool>, event_type: Option<EventRequestType>, ) -> Result<Vec<LedgerDB>, Error>
pub async fn get_subject_state( &self, subject_id: DigestIdentifier, ) -> Result<SubjectDB, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Api
impl !RefUnwindSafe for Api
impl Send for Api
impl Sync for Api
impl Unpin for Api
impl UnsafeUnpin for Api
impl !UnwindSafe for Api
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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