Skip to main content

StorageAccess

Trait StorageAccess 

pub trait StorageAccess<T> {
    // Required methods
    fn as_borrowed(&self) -> &T;
    fn into_taken(self) -> T;
}
Expand description

A trait for borrowing and taking data.

Required Methods§

fn as_borrowed(&self) -> &T

Borrows the value.

fn into_taken(self) -> T

Takes the value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl<T> StorageAccess<T> for SendWrapper<T>

§

fn as_borrowed(&self) -> &T

§

fn into_taken(self) -> T

Implementors§

§

impl<T> StorageAccess<T> for T