Struct kube::runtime::Informer [−][src]
pub struct Informer<K> where
K: Clone + DeserializeOwned + Meta, { /* fields omitted */ }
Expand description
An event informer for a Resource
This watches a Resource<K>
, by:
- seeding the intial resourceVersion with a list call (optional)
- keeping track of resourceVersions during every poll
- recovering when resourceVersions get desynced
Implementations
impl<K> Informer<K> where
K: Clone + DeserializeOwned + Meta,
[src]
impl<K> Informer<K> where
K: Clone + DeserializeOwned + Meta,
[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 kube resource
pub async fn poll(&self) -> Result<impl Stream<Item = Result<WatchEvent<K>>>>
[src]
pub async fn poll(&self) -> Result<impl Stream<Item = Result<WatchEvent<K>>>>
[src]Start a single watch stream
Opens a long polling GET and returns the complete WatchEvents as a Stream. You should always poll. When this call ends, call it again. Do not call it from more than one context.
This function will handle error handling up to a point:
- if we go out of history (410 Gone), we reset to latest
- if we failed an initial poll, we will retry All real errors are bubbled up, as are WachEvent::Error instances. In the retry/reset cases we wait 10s between each attempt.
If you need to track the resourceVersion
you can use Informer::version()
.
Trait Implementations
Auto Trait Implementations
impl<K> !RefUnwindSafe for Informer<K>
impl<K> Send for Informer<K> where
K: Send,
K: Send,
impl<K> Sync for Informer<K> where
K: Sync,
K: Sync,
impl<K> Unpin for Informer<K> where
K: Unpin,
K: Unpin,
impl<K> !UnwindSafe for Informer<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 = T
The 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