Struct taple_core::NodeAPI
source · pub struct NodeAPI { /* private fields */ }
Expand description
Object that allows interaction with a TAPLE node.
It has methods to perform all available read and write operations, as well as an additional action to stop a running node. he interaction is performed thanks to the implementation of a trait known as ApiModuleInterface. Consequently, it is necessary to import the trait in order to properly use the object.
Trait Implementations§
source§impl ApiModuleInterface for NodeAPI
impl ApiModuleInterface for NodeAPI
Feature that allows implementing the API Rest of an Taple node.
fn get_request<'life0, 'async_trait>( &'life0 self, request_id: DigestIdentifier ) -> Pin<Box<dyn Future<Output = Result<TapleRequest, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn external_request<'life0, 'async_trait>(
&'life0 self,
event_request: Signed<EventRequest>
) -> Pin<Box<dyn Future<Output = Result<DigestIdentifier, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn external_request<'life0, 'async_trait>( &'life0 self, event_request: Signed<EventRequest> ) -> Pin<Box<dyn Future<Output = Result<DigestIdentifier, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Allows to make a request to the node from an external Invoker
source§fn get_subjects<'life0, 'async_trait>(
&'life0 self,
namespace: String,
from: Option<String>,
quantity: Option<i64>
) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_subjects<'life0, 'async_trait>( &'life0 self, namespace: String, from: Option<String>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Allows to get all subjects that are known to the current node, regardless of their governance.
Paging can be performed using the optional arguments
from
and quantity
.
Regarding the first one, note that it admits negative values, in which case the paging is
performed in the opposite direction starting from the end of the collection. Note that this method
also returns the subjects that model governance. Read morefn get_subjects_by_governance<'life0, 'async_trait>( &'life0 self, governance_id: DigestIdentifier, from: Option<String>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn get_governances<'life0, 'async_trait>(
&'life0 self,
namespace: String,
from: Option<String>,
quantity: Option<i64>
) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_governances<'life0, 'async_trait>( &'life0 self, namespace: String, from: Option<String>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
It allows to obtain all the subjects that model existing governance in the node. Read more
fn get_event<'life0, 'async_trait>( &'life0 self, subject_id: DigestIdentifier, sn: u64 ) -> Pin<Box<dyn Future<Output = Result<Signed<Event>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn get_events<'life0, 'async_trait>(
&'life0 self,
subject_id: DigestIdentifier,
from: Option<i64>,
quantity: Option<i64>
) -> Pin<Box<dyn Future<Output = Result<Vec<Signed<Event>>, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_events<'life0, 'async_trait>( &'life0 self, subject_id: DigestIdentifier, from: Option<i64>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<Signed<Event>>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Allows to obtain events from a specific subject previously existing in the node.
Paging can be performed by means of the optional arguments
from
and quantity
.
Regarding the former, it should be noted that negative values are allowed, in which case
the paging is performed in the opposite direction starting from the end of the string. Read moresource§fn get_subject<'life0, 'async_trait>(
&'life0 self,
subject_id: DigestIdentifier
) -> Pin<Box<dyn Future<Output = Result<SubjectData, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_subject<'life0, 'async_trait>( &'life0 self, subject_id: DigestIdentifier ) -> Pin<Box<dyn Future<Output = Result<SubjectData, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Allows to obtain a specified subject by specifying its identifier. Read more
source§fn shutdown<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<(), ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn shutdown<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<(), ApiError>> + Send + 'async_trait>>where Self: 'async_trait,
Stops the node, consuming the instance on the fly. This implies that any previously created API
or [NotificationHandler] instances will no longer be functional.
fn get_all_allowed_subjects_and_providers<'life0, 'async_trait>( &'life0 self, from: Option<String>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<(DigestIdentifier, HashSet<KeyIdentifier>)>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn add_keys<'life0, 'async_trait>( &'life0 self, derivator: KeyDerivator ) -> Pin<Box<dyn Future<Output = Result<KeyIdentifier, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn get_validation_proof<'life0, 'async_trait>( &'life0 self, subject_id: DigestIdentifier ) -> Pin<Box<dyn Future<Output = Result<(HashSet<Signature>, ValidationProof), ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn get_governance_subjects<'life0, 'async_trait>( &'life0 self, governance_id: DigestIdentifier, from: Option<String>, quantity: Option<i64> ) -> Pin<Box<dyn Future<Output = Result<Vec<SubjectData>, ApiError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for NodeAPI
impl Send for NodeAPI
impl Sync for NodeAPI
impl Unpin for NodeAPI
impl !UnwindSafe for NodeAPI
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