[][src]Struct kube_runtime::controller::Controller

pub struct Controller<K> where
    K: Clone + Meta + 'static, 
{ /* fields omitted */ }

A builder for controller

Implementations

impl<K> Controller<K> where
    K: Clone + Meta + DeserializeOwned + 'static, 
[src]

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]

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.