pub struct SimulatorLifecycle<R: RouteRegistry + Send + Sync> { /* private fields */ }Expand description
Handles starting and stopping of the simulator.
Implementations§
Source§impl<R: RouteRegistry + Send + Sync> SimulatorLifecycle<R>
impl<R: RouteRegistry + Send + Sync> SimulatorLifecycle<R>
pub fn new( config: SimulatorConfig, service_registry: Arc<RwLock<ServiceRegistry>>, route_registry: Arc<RwLock<R>>, config_loader: ConfigLoader, is_active: Arc<RwLock<bool>>, config_watcher: Arc<RwLock<Option<ConfigWatcher>>>, log_sender: Sender<RequestLogEntry>, ) -> Self
Source§impl<R: RouteRegistry + Send + Sync> SimulatorLifecycle<R>
impl<R: RouteRegistry + Send + Sync> SimulatorLifecycle<R>
pub async fn apply_remote_service( &self, service: ServiceDefinition, ) -> ApicentricResult<()>
pub async fn handle_config_change( &self, change: ConfigChange, ) -> ApicentricResult<()>
pub async fn reload_services_internal(&self) -> ApicentricResult<()>
Trait Implementations§
Source§impl<R: RouteRegistry + Send + Sync> Clone for SimulatorLifecycle<R>
impl<R: RouteRegistry + Send + Sync> Clone for SimulatorLifecycle<R>
Source§impl<R: RouteRegistry + Send + Sync + 'static> Lifecycle for SimulatorLifecycle<R>
impl<R: RouteRegistry + Send + Sync + 'static> Lifecycle for SimulatorLifecycle<R>
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApicentricResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApicentricResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<R> !RefUnwindSafe for SimulatorLifecycle<R>
impl<R> !UnwindSafe for SimulatorLifecycle<R>
impl<R> Freeze for SimulatorLifecycle<R>
impl<R> Send for SimulatorLifecycle<R>
impl<R> Sync for SimulatorLifecycle<R>
impl<R> Unpin for SimulatorLifecycle<R>
impl<R> UnsafeUnpin for SimulatorLifecycle<R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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