pub struct FakeHttpClient { /* private fields */ }Implementations§
Source§impl FakeHttpClient
impl FakeHttpClient
Sourcepub fn scripted(responses: Vec<Result<Response<Bytes>, HttpError>>) -> Self
pub fn scripted(responses: Vec<Result<Response<Bytes>, HttpError>>) -> Self
Responds with responses in order, then always with a 500.
pub fn ok_json(body: &'static str) -> Self
Sourcepub fn owlpost_problem(status: StatusCode, title: &str, detail: &str) -> Self
pub fn owlpost_problem(status: StatusCode, title: &str, detail: &str) -> Self
One Owlpost-shaped application/problem+json error (issue #666).
Sourcepub fn owlpost_rate_limited(retry_after_secs: u64) -> Self
pub fn owlpost_rate_limited(retry_after_secs: u64) -> Self
Owlpost’s 429: a problem body carrying Retry-After: <secs>, which
the adapter maps to MailError::RateLimited with that delay.
Sourcepub fn colonizer_error(status: StatusCode, message: &str) -> Self
pub fn colonizer_error(status: StatusCode, message: &str) -> Self
One Colonizer-shaped error: {"error": message}.
Sourcepub fn colonizer_rate_limited(retry_after_secs: u64) -> Self
pub fn colonizer_rate_limited(retry_after_secs: u64) -> Self
Colonizer’s 429: an {"error": …} body carrying Retry-After.
Trait Implementations§
Source§impl Clone for FakeHttpClient
impl Clone for FakeHttpClient
Source§impl HttpClient for FakeHttpClient
impl HttpClient for FakeHttpClient
Source§fn send<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends
request and returns the fully-buffered response under the
bounds this port carries: the body is at most
MAX_RESPONSE_BYTES unless an HttpPolicy tightens it, the
exchange is bounded by that policy’s deadline
(enforced through BoundedHttpClient on runtimes that wrap),
the destination is vetted where real sockets are opened, and a
runtime that keeps a concurrency budget holds one for the send. Read moreAuto Trait Implementations§
impl Freeze for FakeHttpClient
impl RefUnwindSafe for FakeHttpClient
impl Send for FakeHttpClient
impl Sync for FakeHttpClient
impl Unpin for FakeHttpClient
impl UnsafeUnpin for FakeHttpClient
impl UnwindSafe for FakeHttpClient
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