Struct kube_runtime::reflector::store::Writer
source · pub struct Writer<K: 'static + Resource>where
K::DynamicType: Eq + Hash,{ /* private fields */ }
Expand description
A writable Store handle
This is exclusive since it’s not safe to share a single Store
between multiple reflectors.
In particular, Restarted
events will clobber the state of other connected reflectors.
Implementations§
source§impl<K: 'static + Resource + Clone> Writer<K>where
K::DynamicType: Eq + Hash + Clone,
impl<K: 'static + Resource + Clone> Writer<K>where K::DynamicType: Eq + Hash + Clone,
sourcepub fn new(dyntype: K::DynamicType) -> Self
pub fn new(dyntype: K::DynamicType) -> Self
Creates a new Writer with the specified dynamic type.
If the dynamic type is default-able (for example when writer is used with
k8s_openapi
types) you can use Default
instead.
sourcepub fn as_reader(&self) -> Store<K>
pub fn as_reader(&self) -> Store<K>
Return a read handle to the store
Multiple read handles may be obtained, by either calling as_reader
multiple times,
or by calling Store::clone()
afterwards.
sourcepub fn apply_watcher_event(&mut self, event: &Event<K>)
pub fn apply_watcher_event(&mut self, event: &Event<K>)
Applies a single watcher event to the store