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