pub struct Controller<Ctx>where
Ctx: Send + Sync + 'static + Context,
Ctx::Error: Send + Sync + 'static,
for<'de> Ctx::Resource: Send + Sync + 'static + Clone + Debug + Serialize + Deserialize<'de>,
<Ctx::Resource as Resource>::DynamicType: Eq + Clone + Hash + Default + Debug + Unpin,{ /* private fields */ }
Expand description
The Controller
watches a set of resources, calling methods on the
provided Context
when events occur.
Implementations§
Source§impl<Ctx> Controller<Ctx>
impl<Ctx> Controller<Ctx>
Sourcepub fn namespaced(
client: Client,
context: Ctx,
namespace: &str,
wc: Config,
) -> Self
pub fn namespaced( client: Client, context: Ctx, namespace: &str, wc: Config, ) -> Self
Creates a new controller for a namespaced resource using the given
client
. The context
given determines the type of resource
to watch (via the Context::Resource
type provided as part of
the trait implementation). The resources to be watched will be
limited to resources in the given namespace
. A watcher::Config
can be given to limit the resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).
Sourcepub fn namespaced_all(client: Client, context: Ctx, wc: Config) -> Self
pub fn namespaced_all(client: Client, context: Ctx, wc: Config) -> Self
Creates a new controller for a namespaced resource using the given
client
. The context
given determines the type of resource to
watch (via the Context::Resource
type provided as part of the
trait implementation). The resources to be watched will not be
limited by namespace. A watcher::Config
can be given to limit the
resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).
Sourcepub fn cluster(client: Client, context: Ctx, wc: Config) -> Self
pub fn cluster(client: Client, context: Ctx, wc: Config) -> Self
Creates a new controller for a cluster-scoped resource using the
given client
. The context
given determines the type of resource
to watch (via the Context::Resource
type provided as part of the
trait implementation). A watcher::Config
can be given to limit the
resources watched (for instance,
watcher::Config::default().labels("app=myapp")
).
pub fn with_concurrency(self, concurrency: u16) -> Self
Auto Trait Implementations§
impl<Ctx> !Freeze for Controller<Ctx>
impl<Ctx> !RefUnwindSafe for Controller<Ctx>
impl<Ctx> Send for Controller<Ctx>
impl<Ctx> !Sync for Controller<Ctx>
impl<Ctx> Unpin for Controller<Ctx>
impl<Ctx> !UnwindSafe for Controller<Ctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more