IndexMap

Struct IndexMap 

Source
pub struct IndexMap<K, V, S = RandomState> { /* private fields */ }
Expand description

IndexMap 連続領域を保証するHashMap

§Safety

table, hashes は table_* メソッドが責任をもつこと 更新とか

いじんないじんないじんな いじったならあらゆるUnitTest書いて通せ

Implementations§

Source§

impl<K, V, S> IndexMap<K, V, S>
where K: Eq + Hash + Clone, S: BuildHasher,

Source

pub fn with_hasher(hash_builder: S) -> Self

Source

pub fn with_capacity(capacity: usize) -> Self
where S: Default,

Source

pub fn new() -> Self
where S: Default,

Source

pub fn with_hasher_capacity(hash_builder: S, capacity: usize) -> Self

Source

pub fn len(&self) -> usize

Source

pub fn iter_values(&self) -> Iter<'_, V>

Source

pub fn iter_keys(&self) -> Iter<'_, K>

Source

pub fn iter(&self) -> IndexMapIter<'_, K, V, S>

Source

pub fn values(&self) -> &Vec<V>

Source

pub fn keys(&self) -> &Vec<K>

Source

pub fn as_index_set(&self) -> &IndexSet<K, S>

Source

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn get_with_index(&self, index: usize) -> Option<&V>

Source

pub fn get_with_index_mut(&mut self, index: usize) -> Option<&mut V>

Source

pub fn get_key_with_index(&self, index: usize) -> Option<&K>

Source

pub fn get_key_value_with_index(&self, index: usize) -> Option<(&K, &V)>

Source

pub fn get_index<Q>(&self, key: &Q) -> Option<usize>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn insert(&mut self, key: K, value: V) -> Option<InsertResult<K, V>>

Source

pub fn entry_mut<'a>(&'a mut self, key: K) -> EntryMut<'a, K, V, S>

Source

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>
where K: Borrow<Q>, Q: Hash + Eq + ?Sized,

Source

pub fn from_kv_vec(k_vec: Vec<K>, v_vec: Vec<V>) -> Self
where S: BuildHasher + Default,

Trait Implementations§

Source§

impl<K: Clone, V: Clone, S: Clone> Clone for IndexMap<K, V, S>

Source§

fn clone(&self) -> IndexMap<K, V, S>

Returns a duplicate 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<K: Debug, V: Debug, S: Debug> Debug for IndexMap<K, V, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, K, V> Deserialize<'de> for IndexMap<K, V>
where K: Deserialize<'de> + Hash + Eq + Clone, V: Deserialize<'de>,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<K, V> Serialize for IndexMap<K, V>
where K: Serialize, V: Serialize,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<K, V, S> Freeze for IndexMap<K, V, S>
where S: Freeze,

§

impl<K, V, S> RefUnwindSafe for IndexMap<K, V, S>

§

impl<K, V, S> Send for IndexMap<K, V, S>
where S: Send, V: Send, K: Send,

§

impl<K, V, S> Sync for IndexMap<K, V, S>
where S: Sync, V: Sync, K: Sync,

§

impl<K, V, S> Unpin for IndexMap<K, V, S>
where S: Unpin, V: Unpin, K: Unpin,

§

impl<K, V, S> UnwindSafe for IndexMap<K, V, S>
where S: UnwindSafe, V: UnwindSafe, K: 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,