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§
sourcetype DynamicType
type DynamicType
Type information for types that do not know their resource information at compile time.
This is equivalent to Resource::DynamicType
.
Required Methods§
sourcefn resource_version(&self) -> Option<Cow<'_, str>>
fn resource_version(&self) -> Option<Cow<'_, str>>
The resource version of the object.
Provided Methods§
sourcefn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
fn api_version(dyntype: &Self::DynamicType) -> Cow<'_, str>
The apiVersion for this object.
sourcefn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
fn to_object_ref(&self, dyntype: Self::DynamicType) -> ObjectRef<Self>
Constructs an ObjectRef
for this object.
Object Safety§
This trait is not object safe.