pub struct TypeReference {
pub group: String,
pub version: String,
pub kind: String,
}Expand description
Represents a type reference that needs to be imported
Fields§
§group: StringGroup (e.g., “k8s.io”, “apiextensions.crossplane.io”)
version: StringVersion (e.g., “v1”, “v1beta1”)
kind: StringKind (e.g., “ObjectMeta”, “Volume”)
Implementations§
Source§impl TypeReference
impl TypeReference
pub fn new(group: String, version: String, kind: String) -> Self
Sourcepub fn from_qualified_name(name: &str) -> Option<Self>
pub fn from_qualified_name(name: &str) -> Option<Self>
Parse a fully qualified type reference like “io.k8s.api.core.v1.ObjectMeta”
Sourcepub fn import_path(&self, from_group: &str, from_version: &str) -> String
pub fn import_path(&self, from_group: &str, from_version: &str) -> String
Get the import path for this reference relative to a base path
Sourcepub fn module_alias(&self) -> String
pub fn module_alias(&self) -> String
Get the module alias for imports
Trait Implementations§
Source§impl Clone for TypeReference
impl Clone for TypeReference
Source§fn clone(&self) -> TypeReference
fn clone(&self) -> TypeReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeReference
impl Debug for TypeReference
Source§impl From<TypeReference> for TypeNode
impl From<TypeReference> for TypeNode
Source§fn from(type_ref: TypeReference) -> Self
fn from(type_ref: TypeReference) -> Self
Converts to this type from the input type.
Source§impl Hash for TypeReference
impl Hash for TypeReference
Source§impl PartialEq for TypeReference
impl PartialEq for TypeReference
impl Eq for TypeReference
impl StructuralPartialEq for TypeReference
Auto Trait Implementations§
impl Freeze for TypeReference
impl RefUnwindSafe for TypeReference
impl Send for TypeReference
impl Sync for TypeReference
impl Unpin for TypeReference
impl UnwindSafe for TypeReference
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.