pub struct ControlState<H>where
H: LifecycleHandle + Clone,{
pub project: String,
pub handle: H,
/* private fields */
}Expand description
State shared by every route of the control plane.
Fields§
§project: StringProject name as declared in the manifest.
handle: HLifecycle handle backing the resource endpoints.
Implementations§
Source§impl<H> ControlState<H>where
H: LifecycleHandle + Clone,
impl<H> ControlState<H>where
H: LifecycleHandle + Clone,
Sourcepub fn new(project: impl Into<String>, handle: H) -> Self
pub fn new(project: impl Into<String>, handle: H) -> Self
Build a new state bound to project and handle, with a
non-installing test metrics handle.
The attached Metrics does not install a global recorder, so
the metrics! macros write nowhere and GET /metrics renders an
empty snapshot. This constructor is meant for tests and embedders
that do not serve metrics. In production, install the recorder
once and use Self::with_metrics instead.
Trait Implementations§
Source§impl<H> Clone for ControlState<H>
impl<H> Clone for ControlState<H>
Source§fn clone(&self) -> ControlState<H>
fn clone(&self) -> ControlState<H>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<H> Freeze for ControlState<H>where
H: Freeze,
impl<H> RefUnwindSafe for ControlState<H>where
H: RefUnwindSafe,
impl<H> Send for ControlState<H>
impl<H> Sync for ControlState<H>
impl<H> Unpin for ControlState<H>where
H: Unpin,
impl<H> UnsafeUnpin for ControlState<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for ControlState<H>where
H: UnwindSafe,
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
Mutably borrows from an owned value. Read more