Skip to main content

App

Struct App 

Source
pub struct App {
    base: AppBase<ServerImpl<Details>>,
    master_enc_key_part: PrivateKey,
    master_enc_key_part_inv: Scalar,
    pseud_factor_secret: B64UU,
}

Fields§

§base: AppBase<ServerImpl<Details>>§master_enc_key_part: PrivateKey§master_enc_key_part_inv: Scalar§pseud_factor_secret: B64UU

Implementations§

Source§

impl App

Source

async fn handle_hub_ping( app: Rc<Self>, signed_req: Json<TicketSigned<PingReq>>, ) -> Result<PingResp>

Source

async fn handle_ehpp(app: Rc<Self>, req: Json<EhppReq>) -> Result<EhppResp>

Implements EhppEP

Methods from Deref<Target = AppBase<ServerImpl<Details>>>§

Source

pub async fn get_object<T>( &self, id: &T::Identifier, ) -> Result<Option<(T, UpdateVersion)>>
where T: ObjectDetails,

Tries to retrieve an object of type T from this server’s object store with the given id, returning Ok(None) if no such object exists.

Source

pub async fn put_object<T>( &self, obj: &T, update: Option<UpdateVersion>, ) -> Result<Option<UpdateVersion>>
where T: ObjectDetails,

Attempts to put an object of type T into the object store, only overwriting the object that is already present when the version of the to-be-overwritten object is passed via update.

Returs Ok(None) when there is already an object present in the store with that id and type, but its version was not specified in update.

Source

pub async fn delete_object<T>(&self, id: T::Identifier) -> Result<bool>
where T: ObjectDetails,

Attempts to delete an object with the given Id; returns true when an object was deleted, and false when no object with the given id was found.

Source

pub fn running_state_or_please_retry( &self, ) -> Result<&RunningState<S::ExtraRunningState>, ErrorCode>

Returns the current RunningState of this server when available. Otherwise returns api::ErrorCode::PleaseRetry.

Source

pub fn running_state_or_internal_error( &self, ) -> Result<&RunningState<S::ExtraRunningState>, ErrorCode>

Returns the current RunningState of this server when available. Otherwise returns api::ErrorCode::InternalError.

Trait Implementations§

Source§

impl App<ServerImpl<Details>> for App

Source§

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.
Source§

fn check_constellation(&self, constellation: &Constellation) -> bool

Checks whether the given constellation properly reflects this server’s configuration.
Source§

fn master_enc_key_part(&self) -> Option<&PrivateKey>

Should return the master encryption key part for PHC and the transcryption.
Source§

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. Read more
Source§

async fn local_task(_weak: Weak<Self>)

Will be invoked for each instance of App that is created.
Source§

async fn global_task(_app: Rc<Self>) -> Result<Infallible>

Will be invoked once for each server, after discovery
Source§

impl Deref for App

Source§

type Target = AppBase<ServerImpl<Details>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more