diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 7b279084..40ae3d7a 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -553,6 +553,16 @@ impl BackupNamespace { Ok(this) } + /// Create a new Namespace attached to parent + /// + /// `name` must be a single level namespace ID, that is, no '/' is allowed. + /// This rule also avoids confusion about the name being a NS or NS-path + pub fn from_parent_ns(parent: &Self, name: String) -> Result { + let mut child = parent.to_owned(); + child.push(name)?; + Ok(child) + } + /// Create a new namespace directly from a vec. /// /// # Safety