Struct Lru

pub(crate) struct Lru<T, const N: usize> { pub(in ::backtrace_rs::symbolize::gimli::lru) len: usize, pub(in ::backtrace_rs::symbolize::gimli::lru) arr: [MaybeUninit<T>; N] }

least-recently-used cache with static size

Fields

len: usize
arr: [MaybeUninit<T>; N]

Implementations

impl<T, const N: usize> Lru<T, N>

fn clear(&mut self)
fn iter(&self) -> impl Iterator<Item = &T>
fn push_front(&mut self, value: T) -> Option<&mut T>
fn move_to_front(&mut self, idx: usize) -> Option<&mut T>

Trait Implementations

impl<T, const N: usize> Default for Lru<T, N>

fn default() -> Self

Auto Trait Implementations

impl<T, const N: usize> Freeze for Lru<T, N> where [MaybeUninit<T>; N]: Freeze,

impl<T, const N: usize> RefUnwindSafe for Lru<T, N> where [MaybeUninit<T>; N]: RefUnwindSafe,

impl<T, const N: usize> Send for Lru<T, N> where [MaybeUninit<T>; N]: Send,

impl<T, const N: usize> Sync for Lru<T, N> where [MaybeUninit<T>; N]: Sync,

impl<T, const N: usize> Unpin for Lru<T, N> where [MaybeUninit<T>; N]: Unpin,

impl<T, const N: usize> UnsafeUnpin for Lru<T, N> where [MaybeUninit<T>; N]: UnsafeUnpin,

impl<T, const N: usize> UnwindSafe for Lru<T, N> where [MaybeUninit<T>; N]: UnwindSafe,

Blanket Implementations

impl<T> Any for Lru<T, N> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Lru<T, N> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Lru<T, N> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Lru<T, N>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for Lru<T, N> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for Lru<T, N>

impl<T, U> Into<U> for Lru<T, N> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Lru<T, N> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for Lru<T, N> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>