Skip to main content

Owner

Trait Owner 

Source
pub trait Owner: Sized + 'static {
    type Storage: Storage;

    // Required methods
    fn into_storage(self) -> Self::Storage;
    fn from_storage(storage: Self::Storage) -> Self;
}
Expand description

Represents the owner of data with an associated storage type.

An Owner is a convenience trait that can be implemented without the need of unsafe that returns a Storage that does require an unsafe implementation. See the notes on Storage to see why this it is required.

Required Associated Types§

Source

type Storage: Storage

The Storage type the owner uses.

Required Methods§

Source

fn into_storage(self) -> Self::Storage

Consumes the Owner into the associated Storage type.

Source

fn from_storage(storage: Self::Storage) -> Self

Consumes the associated Storage into the Owner type.

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.

Implementations on Foreign Types§

Source§

impl Owner for String

Source§

impl<T: 'static> Owner for Vec<T>

Source§

type Storage = AliasableVec<T>

Source§

fn into_storage(self) -> Self::Storage

Source§

fn from_storage(storage: Self::Storage) -> Self

Implementors§

Source§

impl<T> Owner for T
where T: Storage,