Trait Insert

Source
pub trait Insert: Sized {
    type Inserted;

    // Required method
    fn insert(self, core: &mut Core) -> Self::Inserted;
}
Expand description

Insert an object into its respective store

This is the only primitive operation that is directly understood by Service<Objects>. All other operations are built on top of it.

Required Associated Types§

Source

type Inserted

The type of Self, once it has been inserted

Usually this is just Handle<Self>, but there are some more complex cases where this type needs to be customized.

Required Methods§

Source

fn insert(self, core: &mut Core) -> Self::Inserted

Insert the object into its respective store

Inserted objects will automatically be validated in the background. You should not insert an invalid object into the stores, unless you have a specific reason to do so, and you are handling validation errors in a non-standard way.

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§