Schema

Trait Schema 

Source
pub trait Schema: 'static + Sized {
    // Required method
    fn data() -> &'static SchemaData;

    // Provided methods
    fn key<T: ?Sized>() -> Key<Self, T> { ... }
    fn key_mut<T: ?Sized>() -> KeyMut<Self, T> { ... }
    fn key_with_default<Init, ToRef, V, T>(
        init: Init,
        to_ref: ToRef,
    ) -> Key<Self, T>
       where Init: Send + Sync + Fn() -> V + 'static,
             ToRef: Send + Sync + Fn(&V) -> &T + 'static,
             V: 'static,
             T: ?Sized { ... }
    fn key_mut_with_default<Init, ToRef, ToMut, V, T>(
        init: Init,
        to_ref: ToRef,
        to_mut: ToMut,
    ) -> KeyMut<Self, T>
       where Init: Send + Sync + Fn() -> V + 'static,
             ToRef: Send + Sync + Fn(&V) -> &T + 'static,
             ToMut: Send + Sync + Fn(&mut V) -> &mut T + 'static,
             V: 'static,
             T: ?Sized { ... }
}
Expand description

Key collection for CtxMap.

Use schema macro to define a type that implement Schema.

Required Methods§

Source

fn data() -> &'static SchemaData

Provided Methods§

Source

fn key<T: ?Sized>() -> Key<Self, T>

Source

fn key_mut<T: ?Sized>() -> KeyMut<Self, T>

Source

fn key_with_default<Init, ToRef, V, T>( init: Init, to_ref: ToRef, ) -> Key<Self, T>
where Init: Send + Sync + Fn() -> V + 'static, ToRef: Send + Sync + Fn(&V) -> &T + 'static, V: 'static, T: ?Sized,

Source

fn key_mut_with_default<Init, ToRef, ToMut, V, T>( init: Init, to_ref: ToRef, to_mut: ToMut, ) -> KeyMut<Self, T>
where Init: Send + Sync + Fn() -> V + 'static, ToRef: Send + Sync + Fn(&V) -> &T + 'static, ToMut: Send + Sync + Fn(&mut V) -> &mut T + 'static, V: 'static, T: ?Sized,

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§