Trait ResourceBuilder

Source
pub trait ResourceBuilder: Sized {
Show 14 methods // Required methods fn namespace(self, namespace: impl ToString) -> Self; fn owner(self, owner: OwnerReference) -> Self; fn label(self, key: impl ToString, value: impl ToString) -> Self; fn labels( self, labels: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self; fn annotation(self, key: impl ToString, value: impl ToString) -> Self; fn annotations( self, annotations: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self; fn with_resource_version(self, resource_version: String) -> Self; // Provided methods fn metadata(name: impl ToString) -> ObjectMeta { ... } fn app_name(self, name: impl ToString) -> Self { ... } fn app_instance(self, instance: impl ToString) -> Self { ... } fn app_version(self, version: impl ToString) -> Self { ... } fn app_component(self, component: impl ToString) -> Self { ... } fn app_part_of(self, part_of: impl ToString) -> Self { ... } fn app_managed_by(self, managed_by: impl ToString) -> Self { ... }
}

Required Methods§

Source

fn namespace(self, namespace: impl ToString) -> Self

Set namespace for this object

Source

fn owner(self, owner: OwnerReference) -> Self

Set the owner for this object

Source

fn label(self, key: impl ToString, value: impl ToString) -> Self

Set one label for this object. For settins multiple lables at once prefer labels()

Source

fn labels( self, labels: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self

Set labels for this object

Source

fn annotation(self, key: impl ToString, value: impl ToString) -> Self

Set one annotation for this object. For settins multiple lables at once prefer labels()

Source

fn annotations( self, annotations: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self

Set annotations for this object

Source

fn with_resource_version(self, resource_version: String) -> Self

Provided Methods§

Source

fn metadata(name: impl ToString) -> ObjectMeta

Source

fn app_name(self, name: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/name’

Source

fn app_instance(self, instance: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/instance’

Source

fn app_version(self, version: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/version’

Source

fn app_component(self, component: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/component’

Source

fn app_part_of(self, part_of: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/part-of’

Source

fn app_managed_by(self, managed_by: impl ToString) -> Self

Set recommended label ‘app.kubernetes.io/managed-by’

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> ResourceBuilder for T
where T: Metadata<Ty = ObjectMeta>,