Struct CoreSvc

Source
pub struct CoreSvc<G> { /* private fields */ }

Trait Implementations§

Source§

impl<G: Debug> Debug for CoreSvc<G>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<G> Default for CoreSvc<G>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<G: CoreConfig> OrganizationInvitationsService for CoreSvc<G>

Source§

fn create_organization_invitation<'life0, 'async_trait>( &'life0 self, req: Request<CreateOrganizationInvitationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationInvitation>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_organization_invitations_by_organization<'life0, 'async_trait>( &'life0 self, req: Request<ListOrganizationInvitationsByOrganizationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationInvitationList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_orgnization_invites_by_user<'life0, 'async_trait>( &'life0 self, req: Request<ListOrgnizationInvitesByUserRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationInvitationList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_organization_invitation<'life0, 'async_trait>( &'life0 self, req: Request<GetOrganizationInvitationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationInvitation>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn accept_organization_invitation<'life0, 'async_trait>( &'life0 self, req: Request<AcceptOrganizationInvitationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationMember>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn decline_organization_invitation<'life0, 'async_trait>( &'life0 self, req: Request<DeclineOrganizationInvitationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<G: CoreConfig> OrganizationsService for CoreSvc<G>

Source§

fn create_organization<'life0, 'async_trait>( &'life0 self, req: Request<CreateOrganizationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Organization>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_organization<'life0, 'async_trait>( &'life0 self, req: Request<GetOrganizationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Organization>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_organization<'life0, 'async_trait>( &'life0 self, req: Request<UpdateOrganizationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Organization>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_organization_members<'life0, 'async_trait>( &'life0 self, req: Request<ListOrganizationMembersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationMembersList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_organizations_by_user<'life0, 'async_trait>( &'life0 self, req: Request<ListOrganizationsByUserRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<OrganizationsList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_project<'life0, 'async_trait>( &'life0 self, req: Request<CreateProjectRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Project>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_projects<'life0, 'async_trait>( &'life0 self, req: Request<ListProjectsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ProjectsList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<G: CoreConfig> Service<G> for CoreSvc<G>

Source§

async fn run(self, global: Arc<G>, ctx: Context) -> Result<()>

Run the service. This function should return a future that is pending as long as the service is running. When the service finishes without any errors, the future should resolve to Ok(()). As a best practice, the service should stop as soon as the provided context is done. Read more
Source§

fn name(&self) -> Option<&'static str>

Returns the name of the service, if any.
Source§

fn enabled( &self, global: &Arc<Global>, ) -> impl Future<Output = Result<bool, Error>> + Send

Initialize the service and return Ok(true) if the service should be run.
Source§

impl<G: CoreConfig> SessionsService for CoreSvc<G>

Source§

fn register_with_email<'life0, 'async_trait>( &'life0 self, req: Request<RegisterWithEmailRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_register_with_email<'life0, 'async_trait>( &'life0 self, req: Request<CompleteRegisterWithEmailRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NewUserSessionToken>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn login_with_email_options<'life0, 'async_trait>( &'life0 self, req: Request<LoginWithEmailOptionsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<LoginWithEmailOptionsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn login_with_email_and_password<'life0, 'async_trait>( &'life0 self, req: Request<LoginWithEmailAndPasswordRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NewUserSessionToken>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn login_with_google<'life0, 'async_trait>( &'life0 self, req: Request<LoginWithGoogleRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<LoginWithGoogleResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_login_with_google<'life0, 'async_trait>( &'life0 self, req: Request<CompleteLoginWithGoogleRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CompleteLoginWithGoogleResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn login_with_webauthn<'life0, 'async_trait>( &'life0 self, req: Request<LoginWithWebauthnRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NewUserSessionToken>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_user_session_request<'life0, 'async_trait>( &'life0 self, req: Request<CreateUserSessionRequestRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserSessionRequest>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_user_session_request<'life0, 'async_trait>( &'life0 self, req: Request<GetUserSessionRequestRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserSessionRequest>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_user_session_request_by_code<'life0, 'async_trait>( &'life0 self, req: Request<GetUserSessionRequestByCodeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserSessionRequest>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn approve_user_session_request_by_code<'life0, 'async_trait>( &'life0 self, req: Request<ApproveUserSessionRequestByCodeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserSessionRequest>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_user_session_request<'life0, 'async_trait>( &'life0 self, req: Request<CompleteUserSessionRequestRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NewUserSessionToken>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn validate_mfa_for_user_session<'life0, 'async_trait>( &'life0 self, req: Request<ValidateMfaForUserSessionRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserSession>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn refresh_user_session<'life0, 'async_trait>( &'life0 self, req: Request<()>, ) -> Pin<Box<dyn Future<Output = Result<Response<NewUserSessionToken>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn invalidate_user_session<'life0, 'async_trait>( &'life0 self, req: Request<()>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<G: CoreConfig> UsersService for CoreSvc<G>

Source§

fn get_user<'life0, 'async_trait>( &'life0 self, req: Request<GetUserRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<User>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_user<'life0, 'async_trait>( &'life0 self, req: Request<UpdateUserRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<User>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_user_emails<'life0, 'async_trait>( &'life0 self, req: Request<ListUserEmailsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserEmailsList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_user_email<'life0, 'async_trait>( &'life0 self, req: Request<CreateUserEmailRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_create_user_email<'life0, 'async_trait>( &'life0 self, req: Request<CompleteCreateUserEmailRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserEmail>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn delete_user_email<'life0, 'async_trait>( &'life0 self, req: Request<DeleteUserEmailRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UserEmail>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_webauthn_credential<'life0, 'async_trait>( &'life0 self, req: Request<CreateWebauthnCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateWebauthnCredentialResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_create_webauthn_credential<'life0, 'async_trait>( &'life0 self, req: Request<CompleteCreateWebauthnCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WebauthnCredential>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_webauthn_credentials<'life0, 'async_trait>( &'life0 self, req: Request<ListWebauthnCredentialsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WebauthnCredentialsList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn delete_webauthn_credential<'life0, 'async_trait>( &'life0 self, req: Request<DeleteWebauthnCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WebauthnCredential>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_webauthn_challenge<'life0, 'async_trait>( &'life0 self, req: Request<CreateWebauthnChallengeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WebauthnChallenge>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_totp_credential<'life0, 'async_trait>( &'life0 self, req: Request<CreateTotpCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CreateTotpCredentialResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn complete_create_totp_credential<'life0, 'async_trait>( &'life0 self, req: Request<CompleteCreateTotpCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TotpCredential>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_totp_credentials<'life0, 'async_trait>( &'life0 self, req: Request<ListTotpCredentialsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TotpCredentialsList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn delete_totp_credential<'life0, 'async_trait>( &'life0 self, req: Request<DeleteTotpCredentialRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TotpCredential>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn regenerate_recovery_codes<'life0, 'async_trait>( &'life0 self, req: Request<RegenerateRecoveryCodesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<RecoveryCodes>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn delete_user<'life0, 'async_trait>( &'life0 self, req: Request<DeleteUserRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<User>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Auto Trait Implementations§

§

impl<G> Freeze for CoreSvc<G>

§

impl<G> RefUnwindSafe for CoreSvc<G>
where G: RefUnwindSafe,

§

impl<G> Send for CoreSvc<G>
where G: Send,

§

impl<G> Sync for CoreSvc<G>
where G: Sync,

§

impl<G> Unpin for CoreSvc<G>
where G: Unpin,

§

impl<G> UnwindSafe for CoreSvc<G>
where G: UnwindSafe,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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<T, Conn> RunQueryDsl<Conn> for T

Source§

fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>
where Conn: AsyncConnection + Send, Self: ExecuteDsl<Conn> + 'query,

Executes the given command, returning the number of rows affected. Read more
Source§

fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
where U: Send, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Executes the given query, returning a Vec with the returned rows. Read more
Source§

fn load_stream<'conn, 'query, U>( self, conn: &'conn mut Conn, ) -> Self::LoadFuture<'conn>
where Conn: AsyncConnection, U: 'conn, Self: LoadQuery<'query, Conn, U> + 'query,

Executes the given query, returning a Stream with the returned rows. Read more
Source§

fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn((Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn((Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>
where U: Send + 'conn, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Runs the command, and returns the affected row. Read more
Source§

fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
where U: Send, Conn: AsyncConnection, Self: LoadQuery<'query, Conn, U> + 'query,

Runs the command, returning an Vec with the affected rows. Read more
Source§

fn first<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn((Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn((Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
where U: Send + 'conn, Conn: AsyncConnection, Self: LimitDsl, Self::Output: LoadQuery<'query, Conn, U> + Send + 'query,

Attempts to load a single record. Read more
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.
Source§

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

Source§

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

impl<T> ErasedDestructor for T
where T: 'static,