pub struct Runtime {
config: RuntimeConfig,
room_manager: Arc<RoomManager>,
metrics: Arc<RuntimeMetrics>,
media_transport: MediaTransport,
}Expand description
Process services and lifecycle configuration.
Fields§
§config: RuntimeConfig§room_manager: Arc<RoomManager>§metrics: Arc<RuntimeMetrics>§media_transport: MediaTransportImplementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(config: &Config) -> AnyResult<Self>
pub fn new(config: &Config) -> AnyResult<Self>
Builds the room manager and media workers from loaded configuration.
§Errors
Returns anyhow::Error when the authentication key is malformed or
shorter than the HS256 minimum, the diagnostics token is invalid, proxy
mode lacks trusted proxies, listener limits are outside their supported
ranges or the media transport cannot be built.
fn from_services(config: &Config, services: RuntimeServices) -> AnyResult<Self>
Sourcepub async fn serve_listener(
self,
listener: TcpListener,
shutdown: impl Future<Output = ()>,
) -> Result<(), ServeError>
pub async fn serve_listener( self, listener: TcpListener, shutdown: impl Future<Output = ()>, ) -> Result<(), ServeError>
Serves a caller-provided listener until shutdown resolves.
Tokenless operator access follows the listener’s actual local address.
§Errors
Returns ServeError::Io for serving failures or
ServeError::ShutdownIncomplete when the drainage deadline expires.
async fn serve<F, HttpServer, Shutdown>( self, http_server: F, shutdown: Shutdown, ) -> Result<(), ServeError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
impl !UnwindSafe for Runtime
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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