pub struct SessionContext {
pub match_id: String,
pub token: Option<String>,
pub ticket: Option<String>,
pub client_name: String,
pub client_version: String,
pub safe_mode: bool,
}Expand description
Opaque per-session bag the session loop threads through. Public so the conformance harness can construct one.
Fields§
§match_id: String§token: Option<String>§ticket: Option<String>§client_name: String§client_version: String§safe_mode: boolWhen false, a panicking decide() surfaces as
Error::BotDecision instead of being folded to a safe action.
Implementations§
Source§impl SessionContext
impl SessionContext
Sourcepub fn new(
match_id: String,
token: Option<String>,
ticket: Option<String>,
client_name: String,
client_version: String,
) -> Self
pub fn new( match_id: String, token: Option<String>, ticket: Option<String>, client_name: String, client_version: String, ) -> Self
A context with safe_mode on — the common case. Lets existing
callers (tests, conformance harness) construct a context with the
historical field set without naming safe_mode explicitly.
Trait Implementations§
Source§impl Clone for SessionContext
impl Clone for SessionContext
Source§fn clone(&self) -> SessionContext
fn clone(&self) -> SessionContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionContext
impl RefUnwindSafe for SessionContext
impl Send for SessionContext
impl Sync for SessionContext
impl Unpin for SessionContext
impl UnsafeUnpin for SessionContext
impl UnwindSafe for SessionContext
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