Skip to main content

Lookup

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§