pub struct GatewayRuntime { /* private fields */ }Expand description
Restartable owner of one Gateway listener and all work spawned beneath it.
Implementations§
Source§impl GatewayRuntime
impl GatewayRuntime
Sourcepub fn new(
config: GatewayConfig,
token_provider: HashTokenProvider,
) -> GatewayResult<Self>
pub fn new( config: GatewayConfig, token_provider: HashTokenProvider, ) -> GatewayResult<Self>
Creates a stopped runtime after validating owner-defined configuration.
Sourcepub fn with_replay_store(
config: GatewayConfig,
token_provider: HashTokenProvider,
connection_replay: Arc<dyn PeerNonceStore>,
) -> GatewayResult<Self>
pub fn with_replay_store( config: GatewayConfig, token_provider: HashTokenProvider, connection_replay: Arc<dyn PeerNonceStore>, ) -> GatewayResult<Self>
Creates a stopped runtime using an explicit durable or shared replay store for one-use Gateway connection credentials.
Sourcepub fn start(&self) -> GatewayResult<()>
pub fn start(&self) -> GatewayResult<()>
Binds synchronously and starts the listener on one owned runtime thread.
Bind, runtime construction, and thread creation failures are returned before this method reports success.
Sourcepub fn stop(&self, timeout: Duration) -> GatewayResult<()>
pub fn stop(&self, timeout: Duration) -> GatewayResult<()>
Requests graceful shutdown, force-cancels the server future before the deadline when needed, and joins all owned listener and task work.
Sourcepub fn snapshot(&self) -> GatewayRuntimeSnapshot
pub fn snapshot(&self) -> GatewayRuntimeSnapshot
Returns lifecycle, listener, and bounded metric state without exposing credentials or token material.
Trait Implementations§
Source§impl Drop for GatewayRuntime
impl Drop for GatewayRuntime
Auto Trait Implementations§
impl !Freeze for GatewayRuntime
impl !RefUnwindSafe for GatewayRuntime
impl !UnwindSafe for GatewayRuntime
impl Send for GatewayRuntime
impl Sync for GatewayRuntime
impl Unpin for GatewayRuntime
impl UnsafeUnpin for GatewayRuntime
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
Mutably borrows from an owned value. Read more