Trait kube_runtime::reflector::Lookup

source ·
pub trait Lookup {
    type DynamicType;

    // Required methods
    fn kind(dyntype: &Self::DynamicType) -> Cow<'_, str>;
    fn group(dyntype: &Self::DynamicType) -> Cow<'_, str>;
    fn version(dyntype: &Self::DynamicType) -> Cow<'_, str>;
    fn plural(dyntype: &Self::DynamicType) -> Cow<'_, str>;
    fn name(&self) -> Option<Cow<'_, str>>;
    fn namespace(&self) -> Option<Cow<'_, str>>;
    fn resource_version(&self) -> Option<Cow<'_, str>>;
    fn uid(&self) -> Option<Cow<'_, str>>;

    // Provided methods
    fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str> { ... }
    fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self> { ... }
}
Expand description

Minimal lookup behaviour needed by a reflector store.

This trait is blanket-implemented for all Resource objects.

Required Associated Types§

source

type DynamicType

Type information for types that do not know their resource information at compile time. This is equivalent to Resource::DynamicType.

Required Methods§

source

fn kind(dyntype: &Self::DynamicType) -> Cow<'_, str>

The kind for this object.

source

fn group(dyntype: &Self::DynamicType) -> Cow<'_, str>

The group for this object.

source

fn version(dyntype: &Self::DynamicType) -> Cow<'_, str>

The version for this object.

source

fn plural(dyntype: &Self::DynamicType) -> Cow<'_, str>

The plural for this object.

source

fn name(&self) -> Option<Cow<'_, str>>

The name of the object.

source

fn namespace(&self) -> Option<Cow<'_, str>>

The namespace of the object.

source

fn resource_version(&self) -> Option<Cow<'_, str>>

The resource version of the object.

source

fn uid(&self) -> Option<Cow<'_, str>>

The UID of the object.

Provided Methods§

source

fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>

The apiVersion for this object.

source

fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>

Constructs an ObjectRef for this object.

Object Safety§

This trait is not object safe.

Implementors§