Skip to main content

Slots

Trait Slots 

Source
pub unsafe trait Slots: Slots {
    type Layout: Copy + Into<(Self::Capacity, Self::Capacity)>;
    type Owned: Copy + Into<Self::Physical>;
    type Accepted: TryFrom<(Self::Index, Self::Capacity)>;
    type Missing: Copy + Eq;

    // Required methods
    fn excludes(
        capacity: Self::Capacity,
        index: Self::Index,
    ) -> Option<Self::Missing>;
    fn backing(index: Self::Index) -> Self::Missing;
    fn vacant(index: Self::Index) -> Self::Missing;
    fn replaced(
        index: Self::Index,
        expected: RawFd,
        actual: RawFd,
    ) -> Self::Missing;
}
Expand description

§Safety

Layout yields (capacity, accepted_prefix); the prefix fits capacity. Owned conversion preserves identity. Accepted conversion succeeds only in its prefix and stays affine; excludes reports indices outside capacity.

Required Associated Types§

Source

type Layout: Copy + Into<(Self::Capacity, Self::Capacity)>

Source

type Owned: Copy + Into<Self::Physical>

Source

type Accepted: TryFrom<(Self::Index, Self::Capacity)>

Source

type Missing: Copy + Eq

Required Methods§

Source

fn excludes( capacity: Self::Capacity, index: Self::Index, ) -> Option<Self::Missing>

Source

fn backing(index: Self::Index) -> Self::Missing

Source

fn vacant(index: Self::Index) -> Self::Missing

Source

fn replaced(index: Self::Index, expected: RawFd, actual: RawFd) -> Self::Missing

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§