pub struct Needs {
pub copies: u32,
pub away: u32,
pub archived: u32,
pub kept: Kept,
}Expand description
What a policy asks of the copies of a file.
Fields§
§copies: u32How many copies, at least 1.
away: u32How many of them outside the home.
archived: u32How many of them on archive nodes.
kept: KeptWhere devices keep them.
Implementations§
Source§impl Needs
impl Needs
Sourcepub const CRITICAL: Self
pub const CRITICAL: Self
What the Critical policy asks by default: three copies, one of them away from home, in the store; the space’s changes count against it where it is gone.
Sourcepub const ONE: Self
pub const ONE: Self
One copy, in the store: what a content needs that no file holds, as a thumbnail’s, when a device that drops its space removes its copy, as every replica keeps it.
Sourcepub const FALLBACK: Self
pub const FALLBACK: Self
What a file needs when no policy is chosen for it: two copies, one of them on an archive node, in the store, as Standard asks.
Sourcepub fn lacks(&self, disks: usize, away: usize, archived: usize) -> Lacks
pub fn lacks(&self, disks: usize, away: usize, archived: usize) -> Lacks
What a file lacks of this that has copies that count on disks disks, away of
them away from home and archived of them archive nodes’.
Sourcepub fn lacks_of(&self, copies: &[FileCopy]) -> Lacks
pub fn lacks_of(&self, copies: &[FileCopy]) -> Lacks
What a file lacks of this whose copies are copies, as Library::copies_of gives
them: those that count, by their disks’ marks.
Trait Implementations§
impl Copy for Needs
impl Eq for Needs
Source§impl Ord for Needs
impl Ord for Needs
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Needs
impl PartialOrd for Needs
impl StructuralPartialEq for Needs
Auto Trait Implementations§
impl Forget for Needs
impl Freeze for Needs
impl Move for Needs
impl RefUnwindSafe for Needs
impl Send for Needs
impl Sync for Needs
impl Unpin for Needs
impl UnsafeUnpin for Needs
impl UnwindSafe for Needs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.