pub struct ManagementState {
pub mocks: Arc<RwLock<Vec<MockConfig>>>,
pub spec: Option<Arc<OpenApiSpec>>,
pub spec_path: Option<String>,
pub port: u16,
pub start_time: Instant,
pub request_counter: Arc<RwLock<u64>>,
pub proxy_config: Option<Arc<RwLock<ProxyConfig>>>,
pub state_machine_manager: Arc<RwLock<ScenarioStateMachineManager>>,
pub ws_broadcast: Option<Arc<Sender<MockEvent>>>,
pub lifecycle_hooks: Option<Arc<LifecycleHookRegistry>>,
pub rule_explanations: Arc<RwLock<HashMap<String, RuleExplanation>>>,
pub server_config: Option<Arc<RwLock<ServerConfig>>>,
}Expand description
Shared state for the management API
Fields§
§mocks: Arc<RwLock<Vec<MockConfig>>>Collection of mock configurations
spec: Option<Arc<OpenApiSpec>>Optional OpenAPI specification
spec_path: Option<String>Optional path to the OpenAPI spec file
port: u16Server port number
start_time: InstantServer start time for uptime calculation
request_counter: Arc<RwLock<u64>>Counter for total requests processed
proxy_config: Option<Arc<RwLock<ProxyConfig>>>Optional proxy configuration for migration pipeline
state_machine_manager: Arc<RwLock<ScenarioStateMachineManager>>State machine manager for scenario state machines
ws_broadcast: Option<Arc<Sender<MockEvent>>>Optional WebSocket broadcast channel for real-time updates
lifecycle_hooks: Option<Arc<LifecycleHookRegistry>>Lifecycle hook registry for extensibility
rule_explanations: Arc<RwLock<HashMap<String, RuleExplanation>>>Rule explanations storage (in-memory for now)
server_config: Option<Arc<RwLock<ServerConfig>>>Optional server configuration for profile application
Implementations§
Source§impl ManagementState
impl ManagementState
Sourcepub fn new(
spec: Option<Arc<OpenApiSpec>>,
spec_path: Option<String>,
port: u16,
) -> Self
pub fn new( spec: Option<Arc<OpenApiSpec>>, spec_path: Option<String>, port: u16, ) -> Self
Create a new management state
§Arguments
spec- Optional OpenAPI specificationspec_path- Optional path to the OpenAPI spec fileport- Server port number
Sourcepub fn with_lifecycle_hooks(self, hooks: Arc<LifecycleHookRegistry>) -> Self
pub fn with_lifecycle_hooks(self, hooks: Arc<LifecycleHookRegistry>) -> Self
Add lifecycle hook registry to management state
Sourcepub fn with_ws_broadcast(self, ws_broadcast: Arc<Sender<MockEvent>>) -> Self
pub fn with_ws_broadcast(self, ws_broadcast: Arc<Sender<MockEvent>>) -> Self
Add WebSocket broadcast channel to management state
Sourcepub fn with_proxy_config(self, proxy_config: Arc<RwLock<ProxyConfig>>) -> Self
pub fn with_proxy_config(self, proxy_config: Arc<RwLock<ProxyConfig>>) -> Self
Add proxy configuration to management state
Sourcepub fn with_server_config(
self,
server_config: Arc<RwLock<ServerConfig>>,
) -> Self
pub fn with_server_config( self, server_config: Arc<RwLock<ServerConfig>>, ) -> Self
Add server configuration to management state
Trait Implementations§
Source§impl Clone for ManagementState
impl Clone for ManagementState
Source§fn clone(&self) -> ManagementState
fn clone(&self) -> ManagementState
Returns a duplicate 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 ManagementState
impl !RefUnwindSafe for ManagementState
impl Send for ManagementState
impl Sync for ManagementState
impl Unpin for ManagementState
impl !UnwindSafe for ManagementState
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request