Skip to main content

oxilean_kernel/arena/
arena_traits.rs

1//! # Arena - Trait Implementations
2//!
3//! This module contains trait implementations for `Arena`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Default`
8//! - `Index`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use super::types::{Arena, Idx};
13
14impl<T> Default for Arena<T> {
15    fn default() -> Self {
16        Self::new()
17    }
18}
19
20impl<T> std::ops::Index<Idx<T>> for Arena<T> {
21    type Output = T;
22    fn index(&self, idx: Idx<T>) -> &T {
23        self.get(idx)
24    }
25}