pub struct ServerState { /* private fields */ }Expand description
Cloneable shared state passed to all server transports.
Implementations§
Source§impl ServerState
impl ServerState
Sourcepub async fn build(config: ServerConfig) -> Result<Self, ServerError>
pub async fn build(config: ServerConfig) -> Result<Self, ServerError>
Build shared state from operator configuration.
§Errors
Returns ServerError if the store cannot connect or the engine cannot
be constructed.
Sourcepub async fn build_with_store<S>(
store: S,
runtime: RuntimeConfig,
) -> Result<Self, ServerError>where
S: EventStore,
pub async fn build_with_store<S>(
store: S,
runtime: RuntimeConfig,
) -> Result<Self, ServerError>where
S: EventStore,
Build shared state from an already-constructed store.
§Errors
Returns ServerError::EngineCall if the engine cannot be constructed.
Sourcepub fn from_parts(
namespace_resolver: NamespaceResolver,
runtime: RuntimeConfig,
) -> Self
pub fn from_parts( namespace_resolver: NamespaceResolver, runtime: RuntimeConfig, ) -> Self
Build shared state from explicit parts with a default worker registry.
Sourcepub fn from_parts_with_registry(
namespace_resolver: NamespaceResolver,
runtime: RuntimeConfig,
worker_registry: ConnectedWorkerRegistry,
) -> Self
pub fn from_parts_with_registry( namespace_resolver: NamespaceResolver, runtime: RuntimeConfig, worker_registry: ConnectedWorkerRegistry, ) -> Self
Build shared state from explicit parts with a caller-supplied registry.
Sourcepub fn namespace_guard(&self) -> &NamespaceGuard
pub fn namespace_guard(&self) -> &NamespaceGuard
Borrow the namespace guard shared by all transports.
Sourcepub fn deploy_guard(&self) -> DeployGuard
pub fn deploy_guard(&self) -> DeployGuard
Build the deploy authorization guard over the shared resolver.
Sourcepub fn runtime_config(&self) -> &RuntimeConfig
pub fn runtime_config(&self) -> &RuntimeConfig
Borrow non-secret runtime settings needed by transports.
Sourcepub fn worker_registry(&self) -> &ConnectedWorkerRegistry
pub fn worker_registry(&self) -> &ConnectedWorkerRegistry
Borrow the connected-worker registry shared by worker transports and dispatch.
Sourcepub fn pending_activities(&self) -> &PendingActivities
pub fn pending_activities(&self) -> &PendingActivities
Borrow the pending-activities tracker shared by the NIF bridge and worker stream handler.
Sourcepub fn heartbeat_tracker(&self) -> &HeartbeatTracker
pub fn heartbeat_tracker(&self) -> &HeartbeatTracker
Borrow the heartbeat/liveness tracker shared by dispatch and worker streams.
Sourcepub fn drain_state(&self) -> &DrainState
pub fn drain_state(&self) -> &DrainState
Borrow the drain gate shared by transports and worker dispatch.
Sourcepub fn metrics(&self) -> Option<&Metrics>
pub fn metrics(&self) -> Option<&Metrics>
Borrow the prometheus metrics handle when this state was built with a store.
Sourcepub fn health(&self) -> Option<&HealthState>
pub fn health(&self) -> Option<&HealthState>
Borrow health probe state when this state was built with a store.
Sourcepub fn shutdown(&self) -> Result<(), ServerError>
pub fn shutdown(&self) -> Result<(), ServerError>
Shut down the embedded engine so in-flight durable appends can finish.
§Errors
Returns ServerError if the namespace resolver has no engine handle or the engine rejects
shutdown.
Trait Implementations§
Source§impl Clone for ServerState
impl Clone for ServerState
Source§fn clone(&self) -> ServerState
fn clone(&self) -> ServerState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Freeze for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request