pub struct RedDBServer { /* private fields */ }Implementations§
Source§impl RedDBServer
impl RedDBServer
pub fn new(runtime: RedDBRuntime) -> RedDBServer
pub fn from_database_options( db_options: RedDBOptions, server_options: ServerOptions, ) -> Result<RedDBServer, RedDBError>
pub fn with_options( runtime: RedDBRuntime, options: ServerOptions, ) -> RedDBServer
Sourcepub fn with_http_limits(self, limits: HttpLimitsResolved) -> RedDBServer
pub fn with_http_limits(self, limits: HttpLimitsResolved) -> RedDBServer
Stamp resolved HTTP limits onto the server (issue #574 slice 5).
Replaces the limiter cap, the per-handler deadline, and the
Retry-After value used by the limiter’s reject path. All
values are assumed validated by http_limits::resolve_http_limits.
Sourcepub fn with_auth(self, auth_store: Arc<AuthStore>) -> RedDBServer
pub fn with_auth(self, auth_store: Arc<AuthStore>) -> RedDBServer
Attach an AuthStore for HTTP-layer authentication.
Also injects the store into the runtime so that Value::Secret
auto-encrypt/decrypt can reach the vault AES key.
Sourcepub fn with_replication(self, state: Arc<ServerReplicationState>) -> RedDBServer
pub fn with_replication(self, state: Arc<ServerReplicationState>) -> RedDBServer
Attach replication state for status and snapshot endpoints.
Sourcepub fn with_websocket_allowed_origins(self, origins: Vec<String>) -> RedDBServer
pub fn with_websocket_allowed_origins(self, origins: Vec<String>) -> RedDBServer
Set the Origin allowlist that enables the RedWire-over-WSS
browser endpoint (issue #935, ADR 0036). A non-empty list mounts
the /redwire upgrade route on the TLS edge; an empty list leaves
it unmounted (default-deny).
Sourcepub fn with_ui_dir(self, dir: PathBuf) -> RedDBServer
pub fn with_ui_dir(self, dir: PathBuf) -> RedDBServer
Serve the resolved red-ui bundle from dir as inert static assets
on this listener (red server --ui, issue #1047, ADR 0051). The
bundle is served as a fallback after the API routing table, so it
can never shadow a real endpoint; GET / resolves to the bundle’s
index.html.
Enable the browser credential layer (issue #936, PRD #930) by
wiring a hybrid-token authority into the runtime. Once set, the
/auth/browser/* HTTP endpoints issue/rotate the access+refresh
pair and the RedWire WS handshake accepts the access JWT. Left
unset, the browser flow is inert (default-deny), matching the WS
endpoint’s own opt-in posture.
pub fn runtime(&self) -> &RedDBRuntime
pub fn options(&self) -> &ServerOptions
pub fn serve(&self) -> Result<(), Error>
Sourcepub fn serve_on(&self, listener: TcpListener) -> Result<(), Error>
pub fn serve_on(&self, listener: TcpListener) -> Result<(), Error>
Serve the async axum/hyper HTTP edge (issue #931) on the given
listener until it errors fatally. A dedicated multi-threaded tokio
runtime drives the I/O; the synchronous disk-backed engine is
reached via spawn_blocking. This replaces the retired
thread-per-connection accept loop and its (2*num_cpus) thread
cap — idle keep-alive connections are now cheap parked tasks.
Sourcepub fn serve_one_on(&self, listener: TcpListener) -> Result<(), Error>
pub fn serve_one_on(&self, listener: TcpListener) -> Result<(), Error>
Accept and serve a single connection to completion, then return. Used by tests that want a one-shot HTTP server alongside another transport.
pub fn serve_in_background(&self) -> JoinHandle<Result<(), Error>>
pub fn serve_in_background_on( &self, listener: TcpListener, ) -> JoinHandle<Result<(), Error>>
Sourcepub fn serve_tls(&self, tls_config: Arc<ServerConfig>) -> Result<(), Error>
pub fn serve_tls(&self, tls_config: Arc<ServerConfig>) -> Result<(), Error>
Serve TLS-wrapped HTTPS on the configured bind_addr. The
tls_config is shared across all connections (rustls
ServerConfig is Send + Sync).
pub fn serve_tls_on( &self, listener: TcpListener, tls_config: Arc<ServerConfig>, ) -> Result<(), Error>
pub fn serve_tls_in_background( &self, tls_config: Arc<ServerConfig>, ) -> JoinHandle<Result<(), Error>>
pub fn serve_tls_in_background_on( &self, listener: TcpListener, tls_config: Arc<ServerConfig>, ) -> JoinHandle<Result<(), Error>>
Trait Implementations§
Source§impl Clone for RedDBServer
impl Clone for RedDBServer
Source§fn clone(&self) -> RedDBServer
fn clone(&self) -> RedDBServer
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 RedDBServer
impl !UnwindSafe for RedDBServer
impl Forget for RedDBServer
impl Freeze for RedDBServerwhere
*const ArcInner<RuntimeBackgroundTasks> is !null: Freeze,
PhantomData<ArcInner<RuntimeBackgroundTasks>>: Freeze,
*const ArcInner<RuntimeInner> is !null: Freeze,
PhantomData<ArcInner<RuntimeInner>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TransportListenerState>: Freeze,
PhantomData<TransportListenerFailure>: Freeze,
PhantomData<String>: Freeze,
*const ArcInner<AuthStore> is !null: Freeze,
PhantomData<ArcInner<AuthStore>>: Freeze,
*const ArcInner<ServerReplicationState> is !null: Freeze,
PhantomData<ArcInner<ServerReplicationState>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<dyn MonotonicClock> is !null: Freeze,
PhantomData<ArcInner<dyn MonotonicClock>>: Freeze,
*const ArcInner<Atomic<u64>> is !null: Freeze,
PhantomData<ArcInner<Atomic<u64>>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<Mutex<HashMap<HttpRequestLabels, u64>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<HashMap<HttpRequestLabels, u64>>>>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const ArcInner<StreamCapacityRegistry> is !null: Freeze,
PhantomData<ArcInner<StreamCapacityRegistry>>: Freeze,
*const ArcInner<LeaseRegistry> is !null: Freeze,
PhantomData<ArcInner<LeaseRegistry>>: Freeze,
*const ArcInner<CursorRegistry> is !null: Freeze,
PhantomData<ArcInner<CursorRegistry>>: Freeze,
impl Move for RedDBServer
impl Send for RedDBServerwhere
Arc<RuntimeBackgroundTasks>: Send,
Arc<RuntimeInner>: Send,
RawVecInner: Send,
Arc<AuthStore>: Send,
Arc<ServerReplicationState>: Send,
Arc<Inner>: Send,
Arc<Inner>: Send,
Arc<dyn MonotonicClock>: Send,
Arc<Atomic<u64>>: Send,
Arc<Inner>: Send,
Arc<Mutex<HashMap<HttpRequestLabels, u64>>>: Send,
Arc<Inner>: Send,
Arc<StreamCapacityRegistry>: Send,
Arc<LeaseRegistry>: Send,
Arc<CursorRegistry>: Send,
impl Sync for RedDBServerwhere
Arc<RuntimeBackgroundTasks>: Sync,
Arc<RuntimeInner>: Sync,
RawVecInner: Sync,
Arc<AuthStore>: Sync,
Arc<ServerReplicationState>: Sync,
Arc<Inner>: Sync,
Arc<Inner>: Sync,
Arc<dyn MonotonicClock>: Sync,
Arc<Atomic<u64>>: Sync,
Arc<Inner>: Sync,
Arc<Mutex<HashMap<HttpRequestLabels, u64>>>: Sync,
Arc<Inner>: Sync,
Arc<StreamCapacityRegistry>: Sync,
Arc<LeaseRegistry>: Sync,
Arc<CursorRegistry>: Sync,
impl Unpin for RedDBServerwhere
Arc<RuntimeBackgroundTasks>: Unpin,
Arc<RuntimeInner>: Unpin,
*const u8 is !null: Unpin,
Arc<AuthStore>: Unpin,
Arc<ServerReplicationState>: Unpin,
Arc<Inner>: Unpin,
Arc<Inner>: Unpin,
Arc<dyn MonotonicClock>: Unpin,
Arc<Atomic<u64>>: Unpin,
Arc<Inner>: Unpin,
Arc<Mutex<HashMap<HttpRequestLabels, u64>>>: Unpin,
Arc<Inner>: Unpin,
Arc<StreamCapacityRegistry>: Unpin,
Arc<LeaseRegistry>: Unpin,
Arc<CursorRegistry>: Unpin,
impl UnsafeUnpin for RedDBServerwhere
*const ArcInner<RuntimeBackgroundTasks> is !null: UnsafeUnpin,
PhantomData<ArcInner<RuntimeBackgroundTasks>>: UnsafeUnpin,
*const ArcInner<RuntimeInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<RuntimeInner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TransportListenerState>: UnsafeUnpin,
PhantomData<TransportListenerFailure>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<AuthStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<AuthStore>>: UnsafeUnpin,
*const ArcInner<ServerReplicationState> is !null: UnsafeUnpin,
PhantomData<ArcInner<ServerReplicationState>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<dyn MonotonicClock> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn MonotonicClock>>: UnsafeUnpin,
*const ArcInner<Atomic<u64>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<u64>>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<Mutex<HashMap<HttpRequestLabels, u64>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<HashMap<HttpRequestLabels, u64>>>>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const ArcInner<StreamCapacityRegistry> is !null: UnsafeUnpin,
PhantomData<ArcInner<StreamCapacityRegistry>>: UnsafeUnpin,
*const ArcInner<LeaseRegistry> is !null: UnsafeUnpin,
PhantomData<ArcInner<LeaseRegistry>>: UnsafeUnpin,
*const ArcInner<CursorRegistry> is !null: UnsafeUnpin,
PhantomData<ArcInner<CursorRegistry>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> 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> ⓘ
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> ⓘ
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 moreSource§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