rspace_traits/
space.rs

1/*
2    Appellation: space <module>
3    Created At: 2025.12.26:14:12:46
4    Contrib: @FL03
5*/
6//! This module defines the [`RawSpace`] trait alongside other interfaces for immutable and
7//! mutable access to the inner elements of a container.
8
9/// The [`RawSpace`] trait is used to define a base interface for all containers whose elements
10/// are of **one** specific type.
11pub trait RawSpace {
12    /// The type of elements associated with the container
13    type Elem: ?Sized;
14}
15
16/// [`RawSpaceMut`] is a trait that provides various mutable methods for accessing elements.
17pub trait RawSpaceMut: RawSpace {}
18
19/// [`RawSpaceRef`] is a trait that provides various read-only methods for accessing elements.
20pub trait RawSpaceRef: RawSpace {}
21
22/*
23 ************* Implementations *************
24*/
25impl<C, T> RawSpace for &C
26where
27    C: RawSpace<Elem = T>,
28{
29    type Elem = C::Elem;
30}
31
32impl<C, T> RawSpace for &mut C
33where
34    C: RawSpace<Elem = T>,
35{
36    type Elem = C::Elem;
37}