pub struct MaintenanceInfo {
pub owner: String,
pub quick: MaintenanceCadence,
pub full: MaintenanceCadence,
pub schedule: Option<MaintenanceSchedule>,
}Expand description
Result of kopia maintenance info --json.
interval is kopia’s Go time.Duration in nanoseconds; the schedule block
is optional:
use kopiur_kopia::MaintenanceInfo;
let json = r#"{
"owner": "mydb@prod",
"quick": {"enabled": true, "interval": 3600000000000},
"full": {"enabled": false, "interval": 0}
}"#;
let info: MaintenanceInfo = serde_json::from_str(json).unwrap();
assert_eq!(info.owner, "mydb@prod");
assert!(info.quick.enabled);
assert_eq!(info.quick.interval, 3_600_000_000_000); // 1h in nanos
assert!(!info.full.enabled);
assert!(info.schedule.is_none());Fields§
§owner: StringThe user@host that owns the maintenance lease.
quick: MaintenanceCadenceQuick maintenance cadence.
full: MaintenanceCadenceFull maintenance cadence.
schedule: Option<MaintenanceSchedule>Schedule with next-run timestamps.
Trait Implementations§
Source§impl Clone for MaintenanceInfo
impl Clone for MaintenanceInfo
Source§fn clone(&self) -> MaintenanceInfo
fn clone(&self) -> MaintenanceInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MaintenanceInfo
impl Debug for MaintenanceInfo
Source§impl<'de> Deserialize<'de> for MaintenanceInfo
impl<'de> Deserialize<'de> for MaintenanceInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MaintenanceInfo
impl PartialEq for MaintenanceInfo
Source§fn eq(&self, other: &MaintenanceInfo) -> bool
fn eq(&self, other: &MaintenanceInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MaintenanceInfo
impl Serialize for MaintenanceInfo
impl StructuralPartialEq for MaintenanceInfo
Auto Trait Implementations§
impl Freeze for MaintenanceInfo
impl RefUnwindSafe for MaintenanceInfo
impl Send for MaintenanceInfo
impl Sync for MaintenanceInfo
impl Unpin for MaintenanceInfo
impl UnsafeUnpin for MaintenanceInfo
impl UnwindSafe for MaintenanceInfo
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