pub trait FederationApiExt: IRawFederationApi {
// Provided methods
fn request_single_peer<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = JsonRpcResult<JsonValue>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn request_single_peer_typed<'life0, 'async_trait, Ret>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = PeerResult<Ret>> + Send + 'async_trait>>
where Ret: DeserializeOwned + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn request_single_peer_federation<'life0, 'async_trait, FedRet>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>
where FedRet: DeserializeOwned + Eq + Debug + Clone + MaybeSend + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn request_with_strategy<'life0, 'async_trait, PeerRet, FedRet>(
&'life0 self,
strategy: impl 'async_trait + QueryStrategy<PeerRet, FedRet> + MaybeSend,
method: String,
params: ApiRequestErased,
) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>
where PeerRet: 'async_trait + DeserializeOwned,
FedRet: 'async_trait + Debug,
Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn request_current_consensus<'life0, 'async_trait, Ret>(
&'life0 self,
method: String,
params: ApiRequestErased,
) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
where Ret: DeserializeOwned + Eq + Debug + Clone + MaybeSend + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn request_admin<'life0, 'life1, 'async_trait, Ret>(
&'life0 self,
method: &'life1 str,
params: ApiRequestErased,
auth: ApiAuth,
) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
where Ret: DeserializeOwned + Eq + Debug + Clone + MaybeSend + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn request_admin_no_auth<'life0, 'life1, 'async_trait, Ret>(
&'life0 self,
method: &'life1 str,
params: ApiRequestErased,
) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
where Ret: DeserializeOwned + Eq + Debug + Clone + MaybeSend + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
An extension trait allowing to making federation-wide API call on top
IRawFederationApi
.
Provided Methods§
Sourcefn request_single_peer<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = JsonRpcResult<JsonValue>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn request_single_peer<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = JsonRpcResult<JsonValue>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Make a request to a single peer in the federation with an optional timeout.
fn request_single_peer_typed<'life0, 'async_trait, Ret>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = PeerResult<Ret>> + Send + 'async_trait>>where
Ret: DeserializeOwned + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
Sourcefn request_single_peer_federation<'life0, 'async_trait, FedRet>(
&'life0 self,
timeout: Option<Duration>,
method: String,
params: ApiRequestErased,
peer_id: PeerId,
) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>
fn request_single_peer_federation<'life0, 'async_trait, FedRet>( &'life0 self, timeout: Option<Duration>, method: String, params: ApiRequestErased, peer_id: PeerId, ) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>
Like Self::request_single_peer
, but API more like
Self::request_with_strategy
.
Sourcefn request_with_strategy<'life0, 'async_trait, PeerRet, FedRet>(
&'life0 self,
strategy: impl 'async_trait + QueryStrategy<PeerRet, FedRet> + MaybeSend,
method: String,
params: ApiRequestErased,
) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>where
PeerRet: 'async_trait + DeserializeOwned,
FedRet: 'async_trait + Debug,
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn request_with_strategy<'life0, 'async_trait, PeerRet, FedRet>(
&'life0 self,
strategy: impl 'async_trait + QueryStrategy<PeerRet, FedRet> + MaybeSend,
method: String,
params: ApiRequestErased,
) -> Pin<Box<dyn Future<Output = FederationResult<FedRet>> + Send + 'async_trait>>where
PeerRet: 'async_trait + DeserializeOwned,
FedRet: 'async_trait + Debug,
Self: Sync + 'async_trait,
'life0: 'async_trait,
Make an aggregate request to federation, using strategy
to logically
merge the responses.
fn request_current_consensus<'life0, 'async_trait, Ret>( &'life0 self, method: String, params: ApiRequestErased, ) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
fn request_admin<'life0, 'life1, 'async_trait, Ret>( &'life0 self, method: &'life1 str, params: ApiRequestErased, auth: ApiAuth, ) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
fn request_admin_no_auth<'life0, 'life1, 'async_trait, Ret>( &'life0 self, method: &'life1 str, params: ApiRequestErased, ) -> Pin<Box<dyn Future<Output = FederationResult<Ret>> + Send + 'async_trait>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.