pub struct MockExternalServiceBuilder { /* private fields */ }Expand description
Mock 外部服务构建器
Implementations§
Source§impl MockExternalServiceBuilder
impl MockExternalServiceBuilder
Sourcepub fn respond_to_path(
self,
path: impl Into<String>,
response: ServiceResponse,
) -> Self
pub fn respond_to_path( self, path: impl Into<String>, response: ServiceResponse, ) -> Self
添加响应配置 (匹配路径)
Sourcepub fn respond_to_path_and_method(
self,
path: impl Into<String>,
method: Method,
response: ServiceResponse,
) -> Self
pub fn respond_to_path_and_method( self, path: impl Into<String>, method: Method, response: ServiceResponse, ) -> Self
添加响应配置 (匹配路径和方法)
Sourcepub fn respond_with<F>(self, matcher: F, response: ServiceResponse) -> Self
pub fn respond_with<F>(self, matcher: F, response: ServiceResponse) -> Self
添加自定义响应配置
Sourcepub fn expect(self, expectation: ServiceExpectation) -> Self
pub fn expect(self, expectation: ServiceExpectation) -> Self
设置期望
Sourcepub fn build(self) -> MockExternalService
pub fn build(self) -> MockExternalService
构建 Mock 外部服务
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockExternalServiceBuilder
impl !RefUnwindSafe for MockExternalServiceBuilder
impl Send for MockExternalServiceBuilder
impl Sync for MockExternalServiceBuilder
impl Unpin for MockExternalServiceBuilder
impl UnsafeUnpin for MockExternalServiceBuilder
impl !UnwindSafe for MockExternalServiceBuilder
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