pub struct ModeExtras {
pub mode_id: ExecutionMode,
pub payload: Value,
}Expand description
Mode-specific extras carried on a SessionCreateRequest.
Each variant matches an ExecutionMode value and carries the
settings only that mode cares about. Adding a new mode means adding
a new variant with its own struct — no mode-specific fields ever
leak into the base request.
Fields§
§mode_id: ExecutionMode§payload: ValueImplementations§
Source§impl ModeExtras
impl ModeExtras
pub fn empty(mode_id: ExecutionMode) -> Self
pub fn typed<T>(mode_id: ExecutionMode, extras: T) -> Result<Self, Error>where
T: Serialize,
pub fn decode<T>(
&self,
expected_mode: &ExecutionMode,
) -> Result<Option<T>, Error>where
T: DeserializeOwned,
Trait Implementations§
Source§impl Clone for ModeExtras
impl Clone for ModeExtras
Source§fn clone(&self) -> ModeExtras
fn clone(&self) -> ModeExtras
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 moreSource§impl Debug for ModeExtras
impl Debug for ModeExtras
Source§impl Default for ModeExtras
impl Default for ModeExtras
Source§impl<'de> Deserialize<'de> for ModeExtras
impl<'de> Deserialize<'de> for ModeExtras
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModeExtras
impl RefUnwindSafe for ModeExtras
impl Send for ModeExtras
impl Sync for ModeExtras
impl Unpin for ModeExtras
impl UnsafeUnpin for ModeExtras
impl UnwindSafe for ModeExtras
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