Struct LinkedListPool

Source
pub struct LinkedListPool<T> { /* private fields */ }
Expand description

複数の連結リストをまとめたもの

Implementations§

Source§

impl<T> LinkedListPool<T>

Source

pub fn new() -> Self

LinkedListPoolを生成する。

Source

pub fn concat(&mut self, prev: usize, next: usize) -> bool

prevの後ろにnextを接続する。

Source

pub fn split_before(&mut self, cur: usize)

curの前でリストを切断する。

Source

pub fn split_after(&mut self, cur: usize)

curの後ろでリストを切断する。

Source

pub fn next_of(&self, cur: usize) -> Option<usize>

curの次の要素

Source

pub fn prev_of(&self, cur: usize) -> Option<usize>

curの前の要素

Source

pub fn push(&mut self, value: T)

valueを値としてもつ単一要素の連結リストを追加する。

Source

pub fn first_of(&self, cur: usize) -> usize

curが属する連結リストの先頭を返す。

Time complexity $O(n)$

Source

pub fn last_of(&self, cur: usize) -> usize

curが属する連結リストの末尾を返す。

Time complexity $O(n)$

Source

pub fn iter(&self, cur: usize) -> impl Iterator<Item = &T>

curからcurの属する連結リストの終端までの要素の参照を返すイテレータを返す。

Source

pub fn riter(&self, cur: usize) -> impl Iterator<Item = &T>

curからcurの属する連結リストの先頭までの要素の参照を返すイテレータを返す。

Trait Implementations§

Source§

impl<T: Clone> Clone for LinkedListPool<T>

Source§

fn clone(&self) -> LinkedListPool<T>

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> Default for LinkedListPool<T>

Source§

fn default() -> LinkedListPool<T>

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

Auto Trait Implementations§

§

impl<T> Freeze for LinkedListPool<T>

§

impl<T> RefUnwindSafe for LinkedListPool<T>
where T: RefUnwindSafe,

§

impl<T> Send for LinkedListPool<T>
where T: Send,

§

impl<T> Sync for LinkedListPool<T>
where T: Sync,

§

impl<T> Unpin for LinkedListPool<T>
where T: Unpin,

§

impl<T> UnwindSafe for LinkedListPool<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.