Struct kube::runtime::Reflector [−][src]
pub struct Reflector<K> where
K: Clone + DeserializeOwned + Send + Meta, { /* fields omitted */ }Expand description
A reflection of Resource state in kubernetes
This watches and caches a Resource<K> by:
- seeding the cache from a large initial list call
- keeping track of initial, and subsequent resourceVersions
- recovering when resourceVersions get desynced
It exposes it’s internal state readably through a getter.
Implementations
impl<K> Reflector<K> where
K: Clone + DeserializeOwned + Meta + Send, [src]
impl<K> Reflector<K> where
K: Clone + DeserializeOwned + Meta + Send, [src]pub fn new(client: APIClient, lp: ListParams, r: Resource) -> Self[src]
pub fn new(client: APIClient, lp: ListParams, r: Resource) -> Self[src]Create a reflector with a kube client on a resource
pub async fn init(self) -> Result<Self>[src]
pub async fn init(self) -> Result<Self>[src]Initializes with a full list of data from a large initial LIST call
pub async fn poll(&self) -> Result<()>[src]
pub async fn poll(&self) -> Result<()>[src]Run a single watch poll
If this returns an error, it tries a full refresh. This is meant to be run continually in a thread/task. Spawn one.
pub async fn state(&self) -> Result<Vec<K>>[src]
pub async fn state(&self) -> Result<Vec<K>>[src]Read data for users of the reflector
This is instant if you are reading and writing from the same context.
pub fn get(&self, name: &str) -> Result<Option<K>>[src]
pub fn get(&self, name: &str) -> Result<Option<K>>[src]Read a single entry by name
Will read in the configured namsepace, or globally on non-namespaced reflectors.
If you are using a non-namespaced resources with name clashes,
Try Reflector::get_within instead.
Trait Implementations
Auto Trait Implementations
impl<K> !RefUnwindSafe for Reflector<K>
impl<K> Send for Reflector<K>
impl<K> Sync for Reflector<K>
impl<K> Unpin for Reflector<K>
impl<K> !UnwindSafe for Reflector<K>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more