pub struct MockServerBuilder { /* private fields */ }Expand description
Builder for creating and configuring mock servers
Implementations§
Source§impl MockServerBuilder
impl MockServerBuilder
Sourcepub fn port_range(self, start: u16, end: u16) -> Self
pub fn port_range(self, start: u16, end: u16) -> Self
Set the port range for automatic port discovery Default range is 30000-30100
Sourcepub fn config_file(self, path: impl Into<PathBuf>) -> Self
pub fn config_file(self, path: impl Into<PathBuf>) -> Self
Load configuration from a YAML file
Sourcepub fn openapi_spec(self, path: impl Into<PathBuf>) -> Self
pub fn openapi_spec(self, path: impl Into<PathBuf>) -> Self
Load routes from an OpenAPI specification
Sourcepub fn latency(self, profile: LatencyProfile) -> Self
pub fn latency(self, profile: LatencyProfile) -> Self
Set the latency profile for simulating network delays
Sourcepub fn failures(self, config: FailureConfig) -> Self
pub fn failures(self, config: FailureConfig) -> Self
Enable failure injection with configuration
Sourcepub fn proxy(self, config: ProxyConfig) -> Self
pub fn proxy(self, config: ProxyConfig) -> Self
Enable proxy mode with configuration
Sourcepub fn admin_port(self, port: u16) -> Self
pub fn admin_port(self, port: u16) -> Self
Set admin API port
Sourcepub async fn start(self) -> Result<MockServer>
pub async fn start(self) -> Result<MockServer>
Start the mock server
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockServerBuilder
impl RefUnwindSafe for MockServerBuilder
impl Send for MockServerBuilder
impl Sync for MockServerBuilder
impl Unpin for MockServerBuilder
impl UnwindSafe for MockServerBuilder
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