Skip to main content

ObjectMeta

Trait ObjectMeta 

Source
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§

Source

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).

Source

fn name(&self) -> Option<&str>

metadata.name — the object’s name. None when absent.

Source

fn namespace(&self) -> Option<&str>

metadata.namespace — the object’s namespace scope. None for cluster-scoped objects or before the field is set.

Source

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.

Source

fn has_finalizer(&self, finalizer: &str) -> bool

Whether metadata.finalizers names finalizer. An absent, null or non-list field names none.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl ObjectMeta for Value

Source§

fn uid(&self) -> Option<&str>

Source§

fn name(&self) -> Option<&str>

Source§

fn namespace(&self) -> Option<&str>

Source§

fn deletion_timestamp(&self) -> Option<&str>

Source§

fn has_finalizer(&self, finalizer: &str) -> bool

Implementors§