From 79cf434a797b3f57c1d3b73602b6f681bee1ea7c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 26 May 2022 13:33:58 +0200 Subject: [PATCH] datastore status: impl empty-status constructor for item type we can now use it for the error case and will further use it for the can access namespace but not datastore case in a future patch Signed-off-by: Thomas Lamprecht --- pbs-api-types/src/datastore.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 88724c3e..c96521cb 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -1361,6 +1361,23 @@ pub struct DataStoreStatusListItem { pub gc_status: Option, } +impl DataStoreStatusListItem { + pub fn empty(store: &str, err: Option) -> Self { + DataStoreStatusListItem { + store: store.to_owned(), + total: -1, + used: -1, + avail: -1, + history: None, + history_start: None, + history_delta: None, + estimated_full_date: None, + error: err, + gc_status: None, + } + } +} + pub const ADMIN_DATASTORE_LIST_SNAPSHOTS_RETURN_TYPE: ReturnType = ReturnType { optional: false, schema: &ArraySchema::new(