pub struct ClientBuilder { /* private fields */ }Expand description
Builder for constructing a MockServerClient.
§Example
use mockserver_client::ClientBuilder;
let client = ClientBuilder::new("localhost", 1080)
.context_path("/api")
.secure(true)
.build()
.unwrap();Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(host: impl Into<String>, port: u16) -> Self
pub fn new(host: impl Into<String>, port: u16) -> Self
Create a new builder targeting the given host and port.
Sourcepub fn context_path(self, path: impl Into<String>) -> Self
pub fn context_path(self, path: impl Into<String>) -> Self
Set a context path prefix (e.g., “/mockserver” if deployed behind a reverse proxy).
Sourcepub fn tls_verify(self, verify: bool) -> Self
pub fn tls_verify(self, verify: bool) -> Self
Whether to verify TLS certificates (default: true).
Sourcepub fn build(self) -> Result<MockServerClient>
pub fn build(self) -> Result<MockServerClient>
Build the client.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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