pub trait App<S: Server>: Deref<Target = AppBase<S>> + 'static {
// Required methods
fn configure_actix_app(self: &Rc<Self>, sc: &mut ServiceConfig);
fn check_constellation(&self, constellation: &Constellation) -> bool;
// Provided methods
async fn discover(
self: &Rc<Self>,
phc_inf: DiscoveryInfoResp,
) -> Result<DiscoverVerdict> { ... }
fn master_enc_key_part(&self) -> Option<&PrivateKey> { ... }
async fn local_task(_weak: Weak<Self>) { ... }
async fn global_task(_app: Rc<Self>) -> Result<Infallible> { ... }
}Expand description
What’s common between the actix_web::Apps used by the different PubHubs servers.
Each actix_web::App gets access to an instance of the appropriate implementation of App..
Required Methods§
Sourcefn configure_actix_app(self: &Rc<Self>, sc: &mut ServiceConfig)
fn configure_actix_app(self: &Rc<Self>, sc: &mut ServiceConfig)
Allows App to add server-specific endpoints. Non-server specific endpoints are added by
AppBase::configure_actix_app.
Sourcefn check_constellation(&self, constellation: &Constellation) -> bool
fn check_constellation(&self, constellation: &Constellation) -> bool
Checks whether the given constellation properly reflects this server’s configuration.
Provided Methods§
Sourceasync fn discover(
self: &Rc<Self>,
phc_inf: DiscoveryInfoResp,
) -> Result<DiscoverVerdict>
async fn discover( self: &Rc<Self>, phc_inf: DiscoveryInfoResp, ) -> Result<DiscoverVerdict>
Runs the discovery routine for this server given api::DiscoveryInfoResp already
obtained from Pubhubs Central. If the server is not PHC itself, the Constellation
in this api::DiscoveryInfoResp must be set.
If one of the other servers is not up-to-date
according to this server, discovery of that server is invoked and
api::ErrorCode::PleaseRetry is returned.
Sourcefn master_enc_key_part(&self) -> Option<&PrivateKey>
fn master_enc_key_part(&self) -> Option<&PrivateKey>
Should return the master encryption key part for PHC and the transcryption.
Sourceasync fn local_task(_weak: Weak<Self>)
async fn local_task(_weak: Weak<Self>)
Will be invoked for each instance of App that is created.
Sourceasync fn global_task(_app: Rc<Self>) -> Result<Infallible>
async fn global_task(_app: Rc<Self>) -> Result<Infallible>
Will be invoked once for each server, after discovery
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.