pub struct LighthouseCallbacks {
pub metrics_provider: Arc<dyn MetricsProvider>,
pub scaling_executor: Arc<dyn ScalingExecutor>,
pub observers: Vec<Arc<dyn ScalingObserver>>,
}
Expand description
Combine all callbacks into a single struct for easier management
Fields§
§metrics_provider: Arc<dyn MetricsProvider>
§scaling_executor: Arc<dyn ScalingExecutor>
§observers: Vec<Arc<dyn ScalingObserver>>
Implementations§
Source§impl LighthouseCallbacks
impl LighthouseCallbacks
Sourcepub fn new(
metrics_provider: Arc<dyn MetricsProvider>,
scaling_executor: Arc<dyn ScalingExecutor>,
) -> Self
pub fn new( metrics_provider: Arc<dyn MetricsProvider>, scaling_executor: Arc<dyn ScalingExecutor>, ) -> Self
Create a new callback configuration
Sourcepub fn add_observer(self, observer: Arc<dyn ScalingObserver>) -> Self
pub fn add_observer(self, observer: Arc<dyn ScalingObserver>) -> Self
Add an observer to receive scaling events
Sourcepub fn add_observers(self, observers: Vec<Arc<dyn ScalingObserver>>) -> Self
pub fn add_observers(self, observers: Vec<Arc<dyn ScalingObserver>>) -> Self
Add multiple observers at once
Trait Implementations§
Source§impl Clone for LighthouseCallbacks
impl Clone for LighthouseCallbacks
Source§fn clone(&self) -> LighthouseCallbacks
fn clone(&self) -> LighthouseCallbacks
Returns a copy of the value. Read more
1.0.0 · 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 Freeze for LighthouseCallbacks
impl !RefUnwindSafe for LighthouseCallbacks
impl Send for LighthouseCallbacks
impl Sync for LighthouseCallbacks
impl Unpin for LighthouseCallbacks
impl !UnwindSafe for LighthouseCallbacks
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