Struct sokoban::deque::Deque

source ·
#[repr(C)]
pub struct Deque<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> { pub sequence_number: u64, pub head: u32, pub tail: u32, /* private fields */ }

Fields§

§sequence_number: u64§head: u32§tail: u32

Implementations§

source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Deque<T, MAX_SIZE>

source

pub fn new() -> Self

source

pub fn initialize(&mut self)

source

pub fn front(&self) -> Option<&T>

source

pub fn back(&self) -> Option<&T>

source

pub fn get_next(&self, index: u32) -> u32

source

pub fn get_prev(&self, index: u32) -> u32

source

pub fn push_back(&mut self, node: T)

source

pub fn push_front(&mut self, node: T)

source

pub fn pop_front(&mut self) -> Option<T>

source

pub fn pop_back(&mut self) -> Option<T>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn iter(&self) -> DequeIterator<'_, T, MAX_SIZE>

source

pub fn iter_mut(&mut self) -> DequeIteratorMut<'_, T, MAX_SIZE>

Trait Implementations§

source§

impl<T: Clone + Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Clone for Deque<T, MAX_SIZE>

source§

fn clone(&self) -> Deque<T, MAX_SIZE>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Default for Deque<T, MAX_SIZE>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> FromSlice for Deque<T, MAX_SIZE>

source§

fn new_from_slice(slice: &mut [u8]) -> &mut Self

source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> ZeroCopy for Deque<T, MAX_SIZE>

source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Zeroable for Deque<T, MAX_SIZE>

source§

fn zeroed() -> Self

source§

impl<T: Copy + Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Copy for Deque<T, MAX_SIZE>

source§

impl<T: Default + Copy + Clone + Pod + Zeroable, const MAX_SIZE: usize> Pod for Deque<T, MAX_SIZE>

Auto Trait Implementations§

§

impl<T, const MAX_SIZE: usize> RefUnwindSafe for Deque<T, MAX_SIZE>where T: RefUnwindSafe,

§

impl<T, const MAX_SIZE: usize> Send for Deque<T, MAX_SIZE>where T: Send,

§

impl<T, const MAX_SIZE: usize> Sync for Deque<T, MAX_SIZE>where T: Sync,

§

impl<T, const MAX_SIZE: usize> Unpin for Deque<T, MAX_SIZE>where T: Unpin,

§

impl<T, const MAX_SIZE: usize> UnwindSafe for Deque<T, MAX_SIZE>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> NoUninit for Twhere T: Pod,