pub struct MockTransport<'a> { /* private fields */ }Expand description
Ordered no-allocation mock implementation of BlockingTransport.
Implementations§
Source§impl<'a> MockTransport<'a>
impl<'a> MockTransport<'a>
Sourcepub const fn new(exchanges: &'a [MockExchange<'a>]) -> Self
pub const fn new(exchanges: &'a [MockExchange<'a>]) -> Self
Creates a mock over an ordered exchange slice.
Sourcepub const fn with_endpoint(self, endpoint: EndpointIdentity<'a>) -> Self
pub const fn with_endpoint(self, endpoint: EndpointIdentity<'a>) -> Self
Binds the mock permanently to one normalized endpoint identity.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Reports whether every expected exchange was consumed.
Trait Implementations§
Source§impl AsyncAuthenticatedTransport for MockTransport<'_>
impl AsyncAuthenticatedTransport for MockTransport<'_>
Source§async fn send_authenticated<'transport, 'request, 'policy, 'writer>(
&'transport self,
request: AuthenticatedRequest<'request, 'policy>,
response: &'writer mut ResponseWriter<'_>,
) -> Result<(), Self::Error>where
'transport: 'writer,
'request: 'writer,
'policy: 'writer,
async fn send_authenticated<'transport, 'request, 'policy, 'writer>(
&'transport self,
request: AuthenticatedRequest<'request, 'policy>,
response: &'writer mut ResponseWriter<'_>,
) -> Result<(), Self::Error>where
'transport: 'writer,
'request: 'writer,
'policy: 'writer,
Validates scope and sends one authenticated request.
Source§impl AsyncTransport for MockTransport<'_>
impl AsyncTransport for MockTransport<'_>
Source§async fn send<'transport, 'request, 'writer>(
&'transport self,
request: TransportRequest<'request>,
response: &'writer mut ResponseWriter<'_>,
) -> Result<(), Self::Error>where
'transport: 'writer,
'request: 'writer,
async fn send<'transport, 'request, 'writer>(
&'transport self,
request: TransportRequest<'request>,
response: &'writer mut ResponseWriter<'_>,
) -> Result<(), Self::Error>where
'transport: 'writer,
'request: 'writer,
Sends one request and initializes the complete response body in the
caller buffer. Read more
Source§impl BlockingAuthenticatedTransport for MockTransport<'_>
impl BlockingAuthenticatedTransport for MockTransport<'_>
Source§fn send_authenticated(
&self,
request: AuthenticatedRequest<'_, '_>,
response: &mut ResponseWriter<'_>,
) -> Result<(), Self::Error>
fn send_authenticated( &self, request: AuthenticatedRequest<'_, '_>, response: &mut ResponseWriter<'_>, ) -> Result<(), Self::Error>
Validates scope and sends one authenticated request.
Source§impl BlockingTransport for MockTransport<'_>
impl BlockingTransport for MockTransport<'_>
Source§impl BoundTransport for MockTransport<'_>
impl BoundTransport for MockTransport<'_>
Source§fn endpoint_identity(
&self,
) -> Result<EndpointIdentity<'_>, EndpointIdentityError>
fn endpoint_identity( &self, ) -> Result<EndpointIdentity<'_>, EndpointIdentityError>
Returns the immutable normalized endpoint identity.
Auto Trait Implementations§
impl<'a> !Freeze for MockTransport<'a>
impl<'a> RefUnwindSafe for MockTransport<'a>
impl<'a> Send for MockTransport<'a>
impl<'a> Sync for MockTransport<'a>
impl<'a> Unpin for MockTransport<'a>
impl<'a> UnsafeUnpin for MockTransport<'a>
impl<'a> UnwindSafe for MockTransport<'a>
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