Struct Global

Source
pub(crate) struct Global {
Show 17 fields pub(crate) config: Config, pub(crate) database: Pool<AsyncPgConnection>, pub(crate) user_loader: DataLoader<UserLoader>, pub(crate) organization_loader: DataLoader<OrganizationLoader>, pub(crate) organization_member_by_user_id_loader: DataLoader<OrganizationMemberByUserIdLoader>, pub(crate) external_http_client: Client, pub(crate) webauthn: Webauthn, pub(crate) open_telemetry: OpenTelemetry, pub(crate) redis: Pool, pub(crate) email_service_client: EmailServiceClient<Channel>, pub(crate) geoip_resolver: GeoIpResolver, pub(crate) aws_ses_req_signer: Signer<Credential>, pub(crate) mtls_root_cert: Vec<u8>, pub(crate) mtls_core_cert: Vec<u8>, pub(crate) mtls_core_private_key: Vec<u8>, pub(crate) mtls_email_cert: Vec<u8>, pub(crate) mtls_email_private_key: Vec<u8>,
}

Fields§

§config: Config§database: Pool<AsyncPgConnection>§user_loader: DataLoader<UserLoader>§organization_loader: DataLoader<OrganizationLoader>§organization_member_by_user_id_loader: DataLoader<OrganizationMemberByUserIdLoader>§external_http_client: Client§webauthn: Webauthn§open_telemetry: OpenTelemetry§redis: Pool§email_service_client: EmailServiceClient<Channel>§geoip_resolver: GeoIpResolver§aws_ses_req_signer: Signer<Credential>§mtls_root_cert: Vec<u8>§mtls_core_cert: Vec<u8>§mtls_core_private_key: Vec<u8>§mtls_email_cert: Vec<u8>§mtls_email_private_key: Vec<u8>

Trait Implementations§

Source§

impl AwsInterface for Global

Source§

impl ConfigInterface for Global

Source§

impl ConfigInterface for Global

Source§

impl DatabaseInterface for Global

Source§

impl DataloaderInterface for Global

Source§

impl EmailInterface for Global

Source§

impl GeoIpInterface for Global

Source§

impl Global for Global

Source§

type Config = Config

The config type for the global. Read more
Source§

async fn init(config: Self::Config) -> Result<Arc<Self>>

Initialize the global. Read more
Source§

fn pre_init() -> Result<(), Error>

Pre-initialization. Read more
Source§

fn tokio_runtime() -> Runtime

Builds the tokio runtime for the process. Read more
Source§

fn on_services_start( self: &Arc<Self>, ) -> impl Future<Output = Result<(), Error>> + Send

Called right before all services start. Read more
Source§

fn on_service_exit( self: &Arc<Self>, name: &'static str, result: Result<(), Error>, ) -> impl Future<Output = Result<(), Error>> + Send

Called after a service exits. Read more
Source§

fn on_exit( self: &Arc<Self>, result: Result<(), Error>, ) -> impl Future<Output = Result<(), Error>> + Send

Called after the shutdown is complete, right before exiting the process. Read more
Source§

impl HttpClientInterface for Global

Source§

impl HttpClientInterface for Global

Source§

impl MtlsInterface for Global

Source§

impl MtlsInterface for Global

Source§

impl RedisInterface for Global

Source§

type RedisConnection<'a> = Pool where Self: 'a

Source§

fn redis(&self) -> &Self::RedisConnection<'_>

Source§

impl SignalConfig for Global

Source§

fn signals(&self) -> Vec<SignalKind>

The signals to listen for. Read more
Source§

fn timeout(&self) -> Option<Duration>

The timeout before forcing a shutdown.
Source§

fn on_shutdown( self: &Arc<Self>, ) -> impl Future<Output = Result<(), Error>> + Send

Called when the service is shutting down.
Source§

fn on_force_shutdown( &self, signal: Option<SignalKind>, ) -> impl Future<Output = Result<(), Error>> + Send

Called when the service is force shutting down.
Source§

fn block_global_shutdown(&self) -> impl Future<Output = ()> + Send

Waits for the global shutdown to complete after a signal cancels the local context. Defaults to the global context’s shutdown ([scuffle_context::Handler::global().shutdown()]). Override to use a custom context or condition for shutdown completion.
Source§

impl TelemetryConfig for Global

Source§

fn enabled(&self) -> bool

Return true if the service is enabled.
Source§

fn bind_address(&self) -> Option<SocketAddr>

Return the bind address for the http server.
Source§

fn http_server_name(&self) -> &str

Return the http server name.
Source§

fn opentelemetry(&self) -> Option<&OpenTelemetry>

Pass an OpenTelemetry instance to the service. Read more
Source§

fn health_check(&self) -> impl Future<Output = Result<(), Error>> + Send

Return a health check to determine if the service is healthy. Read more
Source§

fn prometheus_metrics_registry(&self) -> Option<&Registry>

Return a Prometheus metrics registry to scrape metrics from. Read more
Source§

impl WebAuthnInterface for Global

Source§

impl Global for Global

Source§

impl Global for Global

Auto Trait Implementations§

§

impl !Freeze for Global

§

impl !RefUnwindSafe for Global

§

impl Send for Global

§

impl Sync for Global

§

impl Unpin for Global

§

impl !UnwindSafe for Global

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<'s, P, T> CallbackResult<'s, P, T> for P
where T: Logos<'s>,

Source§

fn construct<Constructor>(self, c: Constructor, lex: &mut Lexer<'s, T>)
where Constructor: Fn(P) -> T,

Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
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, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

#[doc(hidden)] const __PRIV_KO9Y329U2U: __Priv<T, W>

Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
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<A, B> IsEqualPrivate<B, Equal> for A

Source§

type Output = B1

Source§

fn is_equal_private( self, _: B, _: Equal, ) -> <A as IsEqualPrivate<B, Equal>>::Output

Source§

impl<A, B> IsEqualPrivate<B, Greater> for A

Source§

impl<A, B> IsEqualPrivate<B, Less> for A

Source§

type Output = B0

Source§

fn is_equal_private( self, _: B, _: Less, ) -> <A as IsEqualPrivate<B, Less>>::Output

Source§

impl<A, B> IsGreaterOrEqualPrivate<B, Equal> for A

Source§

impl<A, B> IsGreaterOrEqualPrivate<B, Greater> for A

Source§

impl<A, B> IsGreaterOrEqualPrivate<B, Less> for A

Source§

impl<A, B> IsGreaterPrivate<B, Equal> for A

Source§

impl<A, B> IsGreaterPrivate<B, Greater> for A

Source§

impl<A, B> IsGreaterPrivate<B, Less> for A

Source§

type Output = B0

Source§

fn is_greater_private( self, _: B, _: Less, ) -> <A as IsGreaterPrivate<B, Less>>::Output

Source§

impl<A, B> IsLessOrEqualPrivate<B, Equal> for A

Source§

impl<A, B> IsLessOrEqualPrivate<B, Greater> for A

Source§

impl<A, B> IsLessOrEqualPrivate<B, Less> for A

Source§

impl<A, B> IsLessPrivate<B, Equal> for A

Source§

type Output = B0

Source§

fn is_less_private( self, _: B, _: Equal, ) -> <A as IsLessPrivate<B, Equal>>::Output

Source§

impl<A, B> IsLessPrivate<B, Greater> for A

Source§

type Output = B0

Source§

fn is_less_private( self, _: B, _: Greater, ) -> <A as IsLessPrivate<B, Greater>>::Output

Source§

impl<A, B> IsLessPrivate<B, Less> for A

Source§

type Output = B1

Source§

fn is_less_private(self, _: B, _: Less) -> <A as IsLessPrivate<B, Less>>::Output

Source§

impl<A, B> IsNotEqualPrivate<B, Equal> for A

Source§

impl<A, B> IsNotEqualPrivate<B, Greater> for A

Source§

impl<A, B> IsNotEqualPrivate<B, Less> for A

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> SizeEq<Cell<T>> for T
where T: ?Sized,

Source§

fn cast_from_raw(t: PtrInner<'_, Cell<T>>) -> PtrInner<'_, T>

Source§

impl<T> SizeEq<D<T>> for T
where T: ?Sized,

Source§

fn cast_from_raw(t: PtrInner<'_, D<T>>) -> PtrInner<'_, T>

Source§

impl<T> SizeEq<D<T>> for T
where T: ?Sized,

Source§

fn cast_from_raw(t: PtrInner<'_, D<T>>) -> PtrInner<'_, T>

Source§

impl<T> SizeEq<ManuallyDrop<T>> for T
where T: ?Sized,

Source§

impl<T> SizeEq<MaybeUninit<T>> for T

Source§

impl<T> SizeEq<S<T>> for T
where T: ?Sized,

Source§

fn cast_from_raw(t: PtrInner<'_, S<T>>) -> PtrInner<'_, T>

Source§

impl<T> SizeEq<S<T>> for T
where T: ?Sized,

Source§

fn cast_from_raw(t: PtrInner<'_, S<T>>) -> PtrInner<'_, T>

Source§

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

Source§

fn cast_from_raw(t: PtrInner<'_, T>) -> PtrInner<'_, T>

Source§

impl<T> SizeEq<Unalign<T>> for T

Source§

impl<T> SizeEq<UnsafeCell<T>> for T
where T: ?Sized,

Source§

impl<T> SizeEq<Wrapping<T>> for T

Source§

impl<T> SizedTypeProperties for T

Source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Source§

#[doc(hidden)] const LAYOUT: Layout = _

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)] const MAX_SLICE_LEN: usize = _

🔬This is a nightly-only experimental API. (sized_type_properties)
The largest safe length for a [Self]. Read more
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

impl<T> InvariantsEq<D<T>> for T
where T: ?Sized,

Source§

impl<T> InvariantsEq<D<T>> for T
where T: ?Sized,

Source§

impl<T> InvariantsEq<ManuallyDrop<T>> for T
where T: ?Sized,

Source§

impl<T> InvariantsEq<S<T>> for T
where T: ?Sized,

Source§

impl<T> InvariantsEq<S<T>> for T
where T: ?Sized,

Source§

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

Source§

impl<T> InvariantsEq<Unalign<T>> for T

Source§

impl<T> InvariantsEq<Wrapping<T>> for T

Source§

impl<Src, Dst, A, SV, DV, R, S> MutationCompatible<Src, A, SV, DV, (BecauseRead, (R, S))> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: Read<A, R> + ?Sized, Dst: Read<A, S> + ?Sized,

Source§

impl<Src, Dst, A, SV, DV> MutationCompatible<Src, A, SV, DV, BecauseInvariantsEq> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: TransmuteFrom<Dst, DV, SV> + ?Sized, Dst: TransmuteFrom<Src, SV, DV> + InvariantsEq<Src> + ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<Cell<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<D<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<D<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<ManuallyDrop<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<S<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<S<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<Src, Dst> TransmuteFrom<Src, Initialized, Initialized> for Dst
where Src: ?Sized, Dst: ?Sized,

Source§

impl<Src, Dst, V> TransmuteFrom<Src, V, Uninit> for Dst
where V: Validity, Src: ?Sized, Dst: ?Sized,

Source§

impl<Src, Dst> TransmuteFrom<Src, Valid, Initialized> for Dst
where Src: IntoBytes + ?Sized, Dst: ?Sized,

Source§

impl<T> TransmuteFrom<Unalign<T>, Valid, Valid> for T

Source§

impl<T> TransmuteFrom<UnsafeCell<T>, Valid, Valid> for T
where T: ?Sized,

Source§

impl<T> TransmuteFrom<Wrapping<T>, Valid, Valid> for T

Source§

impl<Src, Dst, A, SV, DV, R> TransmuteFromPtr<Src, A, SV, DV, R> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Dst: TransmuteFrom<Src, SV, DV> + TryTransmuteFromPtr<Src, A, SV, DV, R> + ?Sized, Src: ?Sized,

Source§

impl<Src, Dst, SV, DV, A, R> TryTransmuteFromPtr<Src, A, SV, DV, (BecauseMutationCompatible, R)> for Dst
where A: Aliasing, SV: Validity, DV: Validity, Src: TransmuteFrom<Dst, DV, SV> + ?Sized, Dst: MutationCompatible<Src, A, SV, DV, R> + SizeEq<Src> + ?Sized,