pub struct TargetStorageView {
pub host: String,
pub home: Option<String>,
pub filesystems: Vec<FilesystemView>,
pub sampled_at_epoch_seconds: Option<u64>,
pub unattributed_no_space: Option<String>,
}Expand description
The storage owner’s published answer for one host.
Fields§
§host: String§home: Option<String>§filesystems: Vec<FilesystemView>§sampled_at_epoch_seconds: Option<u64>§unattributed_no_space: Option<String>A write failed for lack of space without naming where. Every filesystem on the host counts as full until the measurement it triggered says which one is.
Implementations§
Source§impl TargetStorageView
impl TargetStorageView
Sourcepub fn evaluate(
host: &str,
home: Option<String>,
filesystems: &[FilesystemSpace],
sampled_at_epoch_seconds: Option<u64>,
no_space: impl Fn(&FilesystemSpace) -> Option<String>,
unattributed_no_space: Option<String>,
) -> TargetStorageView
pub fn evaluate( host: &str, home: Option<String>, filesystems: &[FilesystemSpace], sampled_at_epoch_seconds: Option<u64>, no_space: impl Fn(&FilesystemSpace) -> Option<String>, unattributed_no_space: Option<String>, ) -> TargetStorageView
Judge each filesystem of one host from its latest measurement and any failure since.
Sourcepub fn filesystem_for(&self, path: &str) -> Option<&FilesystemView>
pub fn filesystem_for(&self, path: &str) -> Option<&FilesystemView>
The filesystem path lands on: the one holding the longest measured
path that contains it.
Sourcepub fn worst_for<'a>(
&self,
paths: impl IntoIterator<Item = &'a str>,
) -> Option<&FilesystemView>
pub fn worst_for<'a>( &self, paths: impl IntoIterator<Item = &'a str>, ) -> Option<&FilesystemView>
The worst filesystem among those paths land on.
Sourcepub fn worst(&self) -> Option<&FilesystemView>
pub fn worst(&self) -> Option<&FilesystemView>
The worst filesystem on the host, for a one-line summary.
Sourcepub fn full_for<'a>(
&self,
paths: impl IntoIterator<Item = &'a str>,
) -> Option<&FilesystemView>
pub fn full_for<'a>( &self, paths: impl IntoIterator<Item = &'a str>, ) -> Option<&FilesystemView>
The full filesystem one of paths lands on, or every filesystem’s
stand-in while a failure is still unattributed.
Sourcepub fn explanation(&self, filesystem: &FilesystemView) -> String
pub fn explanation(&self, filesystem: &FilesystemView) -> String
“precision-3260 has 0 B free on /home (the filesystem reserves 24.69 GB more for root)”.
Sourcepub fn filesystem_lines(&self) -> Vec<String>
pub fn filesystem_lines(&self) -> Vec<String>
One line per filesystem: mount, free space, root reserve, and a flag on the full or low ones.
Sourcepub fn short_status(&self) -> String
pub fn short_status(&self) -> String
A short summary of every filesystem, such as “/: 41.0 GB · /home: 0 B full”.
Sourcepub fn problem_for<'a>(
&self,
paths: impl IntoIterator<Item = &'a str>,
) -> Option<String>
pub fn problem_for<'a>( &self, paths: impl IntoIterator<Item = &'a str>, ) -> Option<String>
“disk full: precision-3260 has 0 B free on /home …” when one of
paths lands on a full filesystem.
Sourcepub fn refuse_write(&self, path: &str, bytes: u64, what: &str) -> Option<String>
pub fn refuse_write(&self, path: &str, bytes: u64, what: &str) -> Option<String>
The refusal for a write of bytes (zero when the size is unknown) to
path, or None when it fits beside WRITE_RESERVE_BYTES or the
path’s filesystem has not been measured.
Trait Implementations§
Source§impl Clone for TargetStorageView
impl Clone for TargetStorageView
Source§fn clone(&self) -> TargetStorageView
fn clone(&self) -> TargetStorageView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetStorageView
impl Debug for TargetStorageView
Source§impl<'de> Deserialize<'de> for TargetStorageView
impl<'de> Deserialize<'de> for TargetStorageView
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetStorageView, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetStorageView, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for TargetStorageView
Source§impl PartialEq for TargetStorageView
impl PartialEq for TargetStorageView
Source§impl Serialize for TargetStorageView
impl Serialize for TargetStorageView
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for TargetStorageView
Auto Trait Implementations§
impl Freeze for TargetStorageView
impl RefUnwindSafe for TargetStorageView
impl Send for TargetStorageView
impl Sync for TargetStorageView
impl Unpin for TargetStorageView
impl UnsafeUnpin for TargetStorageView
impl UnwindSafe for TargetStorageView
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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