Update

Struct Update 

Source
pub struct Update<T: Entry> {
    pub to_evict: Vec<T>,
    pub to_move_back: Vec<T>,
}
Expand description

An Update<T> represents the maintenance operations to perform on a set of Second Chance entries.

Fields§

§to_evict: Vec<T>

List of entries to evict (remove from the cached set).

For files, this is a plain unlink / deletion.

§to_move_back: Vec<T>

List of entries to move back in the list of potential removal victims, in order (i.e., the first entry in to_move_back should be moved directly to the end of the current list, the second entry right after, etc.).

For files, this corresponds to increasing the modification time to, e.g., “now.”

Implementations§

Source§

impl<T: Entry> Update<T>

Source

pub fn new(entries: impl IntoIterator<Item = T>, capacity: usize) -> Self

Determines how to update a second chance list of entries, so that at most capacity entries remain.

Auto Trait Implementations§

§

impl<T> Freeze for Update<T>

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Update<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> 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V