pub struct ServerConfig {
pub openapi_spec: Option<PathBuf>,
pub asyncapi_spec: Option<PathBuf>,
pub proto_spec: Option<PathBuf>,
pub mode: MockMode,
pub upstream: Option<String>,
pub seed: u64,
pub http_addr: SocketAddr,
pub grpc_addr: SocketAddr,
pub ws_path: String,
pub max_body_size: usize,
}Expand description
Runtime configuration.
Fields§
§openapi_spec: Option<PathBuf>OpenAPI spec file.
asyncapi_spec: Option<PathBuf>AsyncAPI spec file.
proto_spec: Option<PathBuf>Protobuf root file.
mode: MockModeRuntime mode.
upstream: Option<String>Upstream base URL for proxy mode.
seed: u64Deterministic seed used by faker.
http_addr: SocketAddrHTTP/WS listen address.
grpc_addr: SocketAddrgRPC listen address.
ws_path: StringWebSocket path.
max_body_size: usizeMaximum request body size in bytes (default 10 MiB).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn validate(&self) -> Result<(), RuntimeError>
pub fn validate(&self) -> Result<(), RuntimeError>
Validate the configuration.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
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 moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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> 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