pub struct HttpState { /* private fields */ }Expand description
HTTP server state shared across all handlers.
Build via HttpState::builder (preferred) or HttpState::new for a
default configuration.
Streaming is stateless: the full StreamStateKind travels in every
HTTP continuation request inside an AEAD-sealed state token, so any
worker behind a load balancer can resume any stream. No session map
is held on the server.
Implementations§
Source§impl HttpState
impl HttpState
Sourcepub fn new(server: Arc<RpcServer>) -> Arc<Self> ⓘ
pub fn new(server: Arc<RpcServer>) -> Arc<Self> ⓘ
Create an HttpState with default configuration. See HttpState::builder
for the full set of knobs.
pub fn builder() -> HttpStateBuilder
Sourcepub fn sticky_drain_handle(&self) -> Option<DrainHandle>
pub fn sticky_drain_handle(&self) -> Option<DrainHandle>
Operator handle for graceful sticky-session drain, or None when
the server is not sticky-enabled. Wire it into a SIGTERM handler.
pub fn token_ttl(&self) -> Duration
pub fn max_body_size(&self) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for HttpState
impl !UnwindSafe for HttpState
impl Freeze for HttpState
impl Send for HttpState
impl Sync for HttpState
impl Unpin for HttpState
impl UnsafeUnpin for HttpState
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