cloacina-python::namespace
Rust
Structs
Section titled “Structs”class TaskNamespace
Section titled “class TaskNamespace”Binding
Python API:
cloaca.TaskNamespace
Python wrapper for TaskNamespace
Fields
Section titled “Fields”| Name | Type | Description |
|---|---|---|
inner |
cloacina::TaskNamespace |
Methods
Section titled “Methods”fn new( tenant_id: &str, package_name: &str, workflow_id: &str, task_id: &str,) -> SelfPython API:
cloaca.TaskNamespace.new
Create a new TaskNamespace
Source
pub fn new(tenant_id: &str, package_name: &str, workflow_id: &str, task_id: &str) -> Self { Self { inner: cloacina::TaskNamespace::new(tenant_id, package_name, workflow_id, task_id), } }from_string
Section titled “from_string”fn from_string(namespace_str: &str) -> PyResult<Self>Python API:
cloaca.TaskNamespace.from_string
Parse TaskNamespace from string format “tenant::package::workflow::task”
Source
pub fn from_string(namespace_str: &str) -> PyResult<Self> { cloacina::TaskNamespace::from_string(namespace_str) .map(|inner| Self { inner }) .map_err(|e| PyValueError::new_err(format!("Invalid namespace format: {}", e))) }tenant_id
Section titled “tenant_id”fn tenant_id(&self) -> &strPython API:
cloaca.TaskNamespace.tenant_id
Get tenant ID
Source
pub fn tenant_id(&self) -> &str { &self.inner.tenant_id }package_name
Section titled “package_name”fn package_name(&self) -> &strPython API:
cloaca.TaskNamespace.package_name
Get package name
Source
pub fn package_name(&self) -> &str { &self.inner.package_name }workflow_id
Section titled “workflow_id”fn workflow_id(&self) -> &strPython API:
cloaca.TaskNamespace.workflow_id
Get workflow ID
Source
pub fn workflow_id(&self) -> &str { &self.inner.workflow_id }task_id
Section titled “task_id”fn task_id(&self) -> &strPython API:
cloaca.TaskNamespace.task_id
Get task ID
Source
pub fn task_id(&self) -> &str { &self.inner.task_id }parent
Section titled “parent”fn parent(&self) -> SelfPython API:
cloaca.TaskNamespace.parent
Get parent namespace (without task_id)
Source
pub fn parent(&self) -> Self { Self { inner: cloacina::TaskNamespace::new( &self.inner.tenant_id, &self.inner.package_name, &self.inner.workflow_id, "", ), } }is_child_of
Section titled “is_child_of”fn is_child_of(&self, parent: &PyTaskNamespace) -> boolPython API:
cloaca.TaskNamespace.is_child_of
Check if this namespace is a child of another
Source
pub fn is_child_of(&self, parent: &PyTaskNamespace) -> bool { self.inner.tenant_id == parent.inner.tenant_id && self.inner.package_name == parent.inner.package_name && self.inner.workflow_id == parent.inner.workflow_id && !self.inner.task_id.is_empty() && parent.inner.task_id.is_empty() }is_sibling_of
Section titled “is_sibling_of”fn is_sibling_of(&self, other: &PyTaskNamespace) -> boolPython API:
cloaca.TaskNamespace.is_sibling_of
Check if this namespace is a sibling of another (same parent)
Source
pub fn is_sibling_of(&self, other: &PyTaskNamespace) -> bool { self.inner.tenant_id == other.inner.tenant_id && self.inner.package_name == other.inner.package_name && self.inner.workflow_id == other.inner.workflow_id && !self.inner.task_id.is_empty() && !other.inner.task_id.is_empty() && self.inner.task_id != other.inner.task_id }__str__
Section titled “__str__”fn __str__(&self) -> StringPython API:
cloaca.TaskNamespace.__str__
String representation
Source
pub fn __str__(&self) -> String { self.inner.to_string() }__repr__
Section titled “__repr__”fn __repr__(&self) -> StringPython API:
cloaca.TaskNamespace.__repr__
String representation
Source
pub fn __repr__(&self) -> String { format!( "TaskNamespace('{}', '{}', '{}', '{}')", self.inner.tenant_id, self.inner.package_name, self.inner.workflow_id, self.inner.task_id ) }__eq__
Section titled “__eq__”fn __eq__(&self, other: &PyTaskNamespace) -> boolPython API:
cloaca.TaskNamespace.__eq__
Equality comparison
Source
pub fn __eq__(&self, other: &PyTaskNamespace) -> bool { self.inner == other.inner }__hash__
Section titled “__hash__”fn __hash__(&self) -> u64Python API:
cloaca.TaskNamespace.__hash__
Hash for use in sets/dicts
Source
pub fn __hash__(&self) -> u64 { use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher};
let mut hasher = DefaultHasher::new(); self.inner.hash(&mut hasher); hasher.finish() }from_rust
Section titled “from_rust”pub
fn from_rust(namespace: cloacina::TaskNamespace) -> SelfConvert from Rust TaskNamespace (for internal use)
Source
pub fn from_rust(namespace: cloacina::TaskNamespace) -> Self { Self { inner: namespace } }to_rust
Section titled “to_rust”pub
fn to_rust(&self) -> cloacina::TaskNamespaceConvert to Rust TaskNamespace (for internal use)
Source
pub fn to_rust(&self) -> cloacina::TaskNamespace { self.inner.clone() }