[−][src]Struct kube_runtime::controller::Controller
A builder for controller
Implementations
impl<K> Controller<K> where
K: Clone + Meta + DeserializeOwned + 'static,
[src]
K: Clone + Meta + DeserializeOwned + 'static,
pub fn new(owned_api: Api<K>, lp: ListParams) -> Self
[src]
Create a Controller on a type K
Configure ListParams
and Api
so you only get reconcile events
for the correct Api scope (cluster/all/namespaced), or ListParams subset
pub fn store(&self) -> Store<K>
[src]
Retrieve a copy of the reader before starting the controller
pub fn owns<Child: Clone + Meta + DeserializeOwned + 'static>(
self,
api: Api<Child>,
lp: ListParams
) -> Self
[src]
self,
api: Api<Child>,
lp: ListParams
) -> Self
Indicate child objets K owns and be notified when they change
This type Child
must have OwnerReferences set to point back to K
.
You can customize the parameters used by the underlying watcher if
only a subset of Child
entries are required.
The api
must have the correct scope (cluster/all namespaces, or namespaced)
pub fn watches<Other: Clone + Meta + DeserializeOwned + 'static, I: 'static + IntoIterator<Item = ObjectRef<K>>>(
self,
api: Api<Other>,
lp: ListParams,
mapper: impl Fn(Other) -> I + 'static
) -> Self
[src]
self,
api: Api<Other>,
lp: ListParams,
mapper: impl Fn(Other) -> I + 'static
) -> Self
Indicate an object to watch with a custom mapper
This mapper should return something like Option<ObjectRef
pub fn run<ReconcilerFut, T>(
self,
reconciler: impl FnMut(K, Context<T>) -> ReconcilerFut,
error_policy: impl FnMut(&ReconcilerFut::Error, Context<T>) -> ReconcilerAction,
context: Context<T>
) -> impl Stream<Item = Result<(ObjectRef<K>, ReconcilerAction), Error<ReconcilerFut::Error, Error>>> where
K: Clone + Meta + 'static,
ReconcilerFut: TryFuture<Ok = ReconcilerAction>,
ReconcilerFut::Error: Error + 'static,
[src]
self,
reconciler: impl FnMut(K, Context<T>) -> ReconcilerFut,
error_policy: impl FnMut(&ReconcilerFut::Error, Context<T>) -> ReconcilerAction,
context: Context<T>
) -> impl Stream<Item = Result<(ObjectRef<K>, ReconcilerAction), Error<ReconcilerFut::Error, Error>>> where
K: Clone + Meta + 'static,
ReconcilerFut: TryFuture<Ok = ReconcilerAction>,
ReconcilerFut::Error: Error + 'static,
Consume all the parameters of the Controller and start the applier stream
This creates a stream from all builder calls and starts an applier with
a specified reconciler
and error_policy
callbacks. Each of these will be called
with a configurable Context
.
Auto Trait Implementations
impl<K> !RefUnwindSafe for Controller<K>
impl<K> !Send for Controller<K>
impl<K> !Sync for Controller<K>
impl<K> Unpin for Controller<K>
impl<K> !UnwindSafe for Controller<K>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,