Skip to main content

ScopeObject

Trait ScopeObject 

Source
pub trait ScopeObject:
    Sized
    + Send
    + Sync
    + Debug
    + 'static {
    type Error: Error + Send + Sync;

    // Required method
    fn deserialize<R: Runtime>(
        app: &AppHandle<R>,
        raw: Value,
    ) -> Result<Self, Self::Error>;
}
Expand description

Marks a type as a scope object.

Usually you will just rely on serde::de::DeserializeOwned instead of implementing it manually, though this is useful if you need to do some initialization logic on the type itself.

Required Associated Types§

Source

type Error: Error + Send + Sync

The error type.

Required Methods§

Source

fn deserialize<R: Runtime>( app: &AppHandle<R>, raw: Value, ) -> Result<Self, Self::Error>

Deserialize the raw scope value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§