pub struct Table<K, V> { /* private fields */ }Implementations§
Source§impl<K: Ord + Copy, V> Table<K, V>
impl<K: Ord + Copy, V> Table<K, V>
pub fn is_complete(&self) -> bool
pub fn get(&self, key: &K) -> Option<&V>
Sourcepub fn release(&mut self, keep: impl Fn(&K) -> bool) -> usize
pub fn release(&mut self, keep: impl Fn(&K) -> bool) -> usize
読み込んだものを、keep のほかは全部捨てる。全部をメモリに持つ表では何もしない。捨てた数
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn contains_key(&self, key: &K) -> bool
Sourcepub fn get_or_insert_with(&mut self, key: K, make: impl FnOnce() -> V) -> &mut V
pub fn get_or_insert_with(&mut self, key: K, make: impl FnOnce() -> V) -> &mut V
なければ make で作って入れる。まだ読んでいないキーなら、記録したうえで作る(その実行は捨てる)
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
Sourcepub fn take_missed(&mut self) -> BTreeSet<K>
pub fn take_missed(&mut self) -> BTreeSet<K>
まだ読んでいないのに引かれたキーを受け取る
Trait Implementations§
Auto Trait Implementations§
impl<K, V> !Freeze for Table<K, V>
impl<K, V> RefUnwindSafe for Table<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Table<K, V>
impl<K, V> Sync for Table<K, V>
impl<K, V> Unpin for Table<K, V>
impl<K, V> UnsafeUnpin for Table<K, V>
impl<K, V> UnwindSafe for Table<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more