Skip to main content

Storage

Trait Storage 

Source
pub trait Storage: Close<State: Retry + Failure> + Sized {
    type Layout: Canary;
    type Index: Copy;
    type Error: Failure<Cleanup = Self::State>;
    type Buffer<const GROUP: u16>;

    // Required methods
    fn new() -> Result<Self, Self::Error>;
    fn into_buffer<const GROUP: u16>(self) -> Self::Buffer<GROUP>;
    unsafe fn option(&mut self) -> &c_int;
    unsafe fn inspect<E>(
        &mut self,
        index: Self::Index,
        len: <<Self::Layout as Receive>::Extent as Extent>::Length,
        check: impl FnOnce(&[u8]) -> Result<(), E>,
    ) -> Result<(), Failure<<Self as Storage>::Index, <<<Self as Storage>::Layout as Receive>::Extent as Extent>::Length, <<<Self as Storage>::Layout as Receive>::Extent as Extent>::Capacity, E>>;
}
Expand description

One owner retains canary payloads, registration entries, and their scalar.

Required Associated Types§

Source

type Layout: Canary

Source

type Index: Copy

Source

type Error: Failure<Cleanup = Self::State>

Source

type Buffer<const GROUP: u16>

Required Methods§

Source

fn new() -> Result<Self, Self::Error>

Source

fn into_buffer<const GROUP: u16>(self) -> Self::Buffer<GROUP>

Source

unsafe fn option(&mut self) -> &c_int

§Safety

No kernel operation or other borrower may access the payload scalar.

Source

unsafe fn inspect<E>( &mut self, index: Self::Index, len: <<Self::Layout as Receive>::Extent as Extent>::Length, check: impl FnOnce(&[u8]) -> Result<(), E>, ) -> Result<(), Failure<<Self as Storage>::Index, <<<Self as Storage>::Layout as Receive>::Extent as Extent>::Length, <<<Self as Storage>::Layout as Receive>::Extent as Extent>::Capacity, E>>

§Safety

A unique CQE transfers any valid reported slot; no other access remains.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§