pub struct ResourceStore { /* private fields */ }Expand description
Unified resource store — single source of truth for all resource instances.
All resources use 3-segment keys: kind/project/name.
Singleton/cluster-scoped resources use _system as their project namespace.
Implementations§
Source§impl ResourceStore
impl ResourceStore
Sourcepub fn get(&self, kind: &str, name: &str) -> Option<&CustomResource>
pub fn get(&self, kind: &str, name: &str) -> Option<&CustomResource>
Get a resource by kind and name (delegates to _system project).
Sourcepub fn get_mut_by_key(&mut self, key: &str) -> Option<&mut CustomResource>
pub fn get_mut_by_key(&mut self, key: &str) -> Option<&mut CustomResource>
Get a mutable reference to a resource by its storage key.
Sourcepub fn get_namespaced(
&self,
kind: &str,
project: &str,
name: &str,
) -> Option<&CustomResource>
pub fn get_namespaced( &self, kind: &str, project: &str, name: &str, ) -> Option<&CustomResource>
Get a namespaced resource by kind, project, and name.
Sourcepub fn list_by_kind(&self, kind: &str) -> Vec<&CustomResource>
pub fn list_by_kind(&self, kind: &str) -> Vec<&CustomResource>
List all resources of a given kind.
Sourcepub fn list_by_kind_for_project(
&self,
kind: &str,
project: &str,
) -> Vec<&CustomResource>
pub fn list_by_kind_for_project( &self, kind: &str, project: &str, ) -> Vec<&CustomResource>
List resources of a given kind within a specific project.
Sourcepub fn put(&mut self, cr: CustomResource) -> ApplyResult
pub fn put(&mut self, cr: CustomResource) -> ApplyResult
Insert or update a resource. Returns the apply result. For project-scoped kinds with no project, auto-assigns DEFAULT_PROJECT_ID.
Sourcepub fn remove(&mut self, kind: &str, name: &str) -> Option<CustomResource>
pub fn remove(&mut self, kind: &str, name: &str) -> Option<CustomResource>
Remove a resource by kind and name (delegates to _system project).
Sourcepub fn remove_first_by_kind_name(
&mut self,
kind: &str,
name: &str,
) -> Option<CustomResource>
pub fn remove_first_by_kind_name( &mut self, kind: &str, name: &str, ) -> Option<CustomResource>
Remove a resource by kind and name from any project namespace.
Scans all entries of the form kind/*/name.
Sourcepub fn remove_namespaced(
&mut self,
kind: &str,
project: &str,
name: &str,
) -> Option<CustomResource>
pub fn remove_namespaced( &mut self, kind: &str, project: &str, name: &str, ) -> Option<CustomResource>
Removes one project-scoped resource by kind, project, and name.
Sourcepub fn remove_all_for_project(&mut self, project: &str)
pub fn remove_all_for_project(&mut self, project: &str)
Removes all resources belonging to a project.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Current generation counter (incremented on each mutation).
Sourcepub fn resources(&self) -> &HashMap<String, CustomResource>
pub fn resources(&self) -> &HashMap<String, CustomResource>
Access the underlying resource map (for iteration/serialization).
Sourcepub fn resources_mut(&mut self) -> &mut HashMap<String, CustomResource>
pub fn resources_mut(&mut self) -> &mut HashMap<String, CustomResource>
Mutable access to the underlying resource map.
Trait Implementations§
Source§impl Clone for ResourceStore
impl Clone for ResourceStore
Source§fn clone(&self) -> ResourceStore
fn clone(&self) -> ResourceStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceStore
impl Debug for ResourceStore
Source§impl Default for ResourceStore
impl Default for ResourceStore
Source§fn default() -> ResourceStore
fn default() -> ResourceStore
Source§impl<'de> Deserialize<'de> for ResourceStore
impl<'de> Deserialize<'de> for ResourceStore
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourceStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourceStore, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl ResourceStoreExt for ResourceStore
impl ResourceStoreExt for ResourceStore
Source§fn project_map<T: CrdProjectable>(&self) -> HashMap<String, T>
fn project_map<T: CrdProjectable>(&self) -> HashMap<String, T>
Source§fn project_singleton<T: CrdProjectable>(&self) -> Option<T>
fn project_singleton<T: CrdProjectable>(&self) -> Option<T>
Source§fn project_singleton_for_project<T: CrdProjectable>(
&self,
project: &str,
) -> Option<T>
fn project_singleton_for_project<T: CrdProjectable>( &self, project: &str, ) -> Option<T>
Source§impl Serialize for ResourceStore
impl Serialize for ResourceStore
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ResourceStore
impl RefUnwindSafe for ResourceStore
impl Send for ResourceStore
impl Sync for ResourceStore
impl Unpin for ResourceStore
impl UnsafeUnpin for ResourceStore
impl UnwindSafe for ResourceStore
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request