pub struct FetchClient;Expand description
The Workers implementation of the HttpClient port: one fetch per
send, through the isolate’s own stack.
Trait Implementations§
Source§impl HttpClient for FetchClient
impl HttpClient for FetchClient
Source§fn send_streaming<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<ByteStream>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_streaming<'life0, 'async_trait>(
&'life0 self,
request: Request<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<Response<ByteStream>, HttpError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The streamed send has no bounds of its own — head deadline, idle
gap and whole-body ceiling, byte cap and declared-length refusal
are all cratefield_core::BoundedHttpClient’s, which every
runtime wires around this transport; a bare FetchClient streams
unbounded. Unlike the buffered HttpClient::send, this path does
not honour a StatusOnly marker: the caller gets the body
stream whatever it marked.
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 FetchClient
impl RefUnwindSafe for FetchClient
impl Send for FetchClient
impl Sync for FetchClient
impl Unpin for FetchClient
impl UnsafeUnpin for FetchClient
impl UnwindSafe for FetchClient
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