pub struct Session { /* private fields */ }Expand description
The process’s negotiation state: whether a legacy session was opened.
Implementations§
Source§impl Session
impl Session
Sourcepub const fn is_legacy(&self) -> bool
pub const fn is_legacy(&self) -> bool
Whether an initialize opened a legacy session on this process.
Sourcepub fn era_of(&self, params: &Map<String, Value>) -> Result<Era, Refusal>
pub fn era_of(&self, params: &Map<String, Value>) -> Result<Era, Refusal>
Decides the era of a request from its params: modern when _meta
carries a supported protocol version and client capabilities; legacy
when a legacy session is open and the request carries no _meta
protocol version; refused otherwise.
§Errors
Returns the unsupported-version error naming the supported versions,
or invalid params naming the missing _meta field.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.