pub enum Context {
Device(Box<DeviceContext, Global>),
Os(Box<OsContext, Global>),
Runtime(Box<RuntimeContext, Global>),
App(Box<AppContext, Global>),
Browser(Box<BrowserContext, Global>),
Other(BTreeMap<String, Value>),
}
Expand description
Typed contextual data.
Types like OsContext
can be directly converted with .into()
to Context
.
Variants
Device(Box<DeviceContext, Global>)
Device data.
Os(Box<OsContext, Global>)
Operating system data.
Runtime(Box<RuntimeContext, Global>)
Runtime data.
App(Box<AppContext, Global>)
Application data.
Browser(Box<BrowserContext, Global>)
Web browser data.
Other(BTreeMap<String, Value>)
Generic other context data.
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<Context, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Context, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<AppContext> for Context
impl From<AppContext> for Context
sourcepub fn from(data: AppContext) -> Context
pub fn from(data: AppContext) -> Context
Performs the conversion.
sourceimpl From<BrowserContext> for Context
impl From<BrowserContext> for Context
sourcepub fn from(data: BrowserContext) -> Context
pub fn from(data: BrowserContext) -> Context
Performs the conversion.
sourceimpl From<DeviceContext> for Context
impl From<DeviceContext> for Context
sourcepub fn from(data: DeviceContext) -> Context
pub fn from(data: DeviceContext) -> Context
Performs the conversion.
sourceimpl From<RuntimeContext> for Context
impl From<RuntimeContext> for Context
sourcepub fn from(data: RuntimeContext) -> Context
pub fn from(data: RuntimeContext) -> Context
Performs the conversion.
sourceimpl Serialize for Context
impl Serialize for Context
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Context
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more