#[allow(missing_docs)]
#[derive(Debug)]
#[derive(Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MountDiagnostic
{
pub source: CString,
pub file_system_type: FileSystemType,
pub mount_options: HashMap<Box<[u8]>, Option<Box<[u8]>>>,
pub dump_frequency_in_days: i32,
pub pass_number_on_parallel_filesystem_type: i32,
pub mount_point_file_system_diagnostics: DiagnosticUnobtainableResult<MountPointFileSystemDiagnostics>,
}
impl MountDiagnostic
{
#[inline(always)]
fn gather(mount: Mount<'static>) -> Self
{
Self
{
source: mount.source,
file_system_type: mount.file_system_type,
mount_options:
{
let from_mount_options = mount.mount_options;
let mut mount_options = HashMap::with_capacity(from_mount_options.len());
for (name, option) in from_mount_options
{
let name = name.into_owned().into_boxed_slice();
let option = option.map(|value| value.into_owned().into_boxed_slice());
mount_options.insert(name, option);
}
mount_options
},
dump_frequency_in_days: mount.dump_frequency_in_days,
pass_number_on_parallel_filesystem_type: mount.pass_number_on_parallel_filesystem_type,
mount_point_file_system_diagnostics: MountPointFileSystemDiagnostics::gather(&mount.mount_point),
}
}
}