pub trait ObjectMeta {
// Required methods
fn uid(&self) -> Option<&str>;
fn name(&self) -> Option<&str>;
fn namespace(&self) -> Option<&str>;
fn deletion_timestamp(&self) -> Option<&str>;
fn has_finalizer(&self, finalizer: &str) -> bool;
// Provided method
fn is_terminating(&self) -> bool { ... }
}Expand description
Borrowed accessors over a K8s object’s metadata + spec.
Implemented for serde_json::Value. The returned &str borrows
from the object, matching the byte-for-byte behavior of the
per-controller accessors this trait replaces.
Required Methods§
Sourcefn uid(&self) -> Option<&str>
fn uid(&self) -> Option<&str>
metadata.uid — the object’s stable identity. None when the
field is absent or empty (a freshly minted object the apiserver has
not stamped yet; an empty uid is no uid).
Sourcefn namespace(&self) -> Option<&str>
fn namespace(&self) -> Option<&str>
metadata.namespace — the object’s namespace scope. None
for cluster-scoped objects or before the field is set.
Sourcefn deletion_timestamp(&self) -> Option<&str>
fn deletion_timestamp(&self) -> Option<&str>
metadata.deletionTimestamp — present once a delete was accepted
for an object that finalizers still hold (Terminating). None when
absent, null or empty: an empty stamp is no stamp.
Sourcefn has_finalizer(&self, finalizer: &str) -> bool
fn has_finalizer(&self, finalizer: &str) -> bool
Whether metadata.finalizers names finalizer. An absent, null
or non-list field names none.
Provided Methods§
Sourcefn is_terminating(&self) -> bool
fn is_terminating(&self) -> bool
Whether the object is Terminating: a delete was accepted and its
finalizers hold it (a Self::deletion_timestamp is present).
A Terminating object is on its way out. A controller never writes
it again as a child: re-creating over it would clear a
deletionTimestamp nothing may clear, and deleting it again is the
store’s NoOp, one Raft entry per tick.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".