pub struct HttpConnector { /* private fields */ }Expand description
HTTP connector for extension hostcalls.
Implementations§
Source§impl HttpConnector
impl HttpConnector
Sourcepub fn new(config: HttpConnectorConfig) -> Self
pub fn new(config: HttpConnectorConfig) -> Self
Create a new HTTP connector with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new HTTP connector with default configuration.
Sourcepub async fn dispatch_streaming(
&self,
call: &HostCallPayload,
) -> Result<StreamingHttpResponse, HostResultPayload>
pub async fn dispatch_streaming( &self, call: &HostCallPayload, ) -> Result<StreamingHttpResponse, HostResultPayload>
Dispatch an HTTP request but return a streaming response body instead of buffering it.
Errors are returned as a HostResultPayload (taxonomy-correct) so the caller can
convert into HostcallOutcome::Error deterministically.
Trait Implementations§
Source§impl Connector for HttpConnector
impl Connector for HttpConnector
Source§fn capability(&self) -> &'static str
fn capability(&self) -> &'static str
The capability name this connector handles (e.g., “http”, “fs”).
Auto Trait Implementations§
impl Freeze for HttpConnector
impl !RefUnwindSafe for HttpConnector
impl Send for HttpConnector
impl Sync for HttpConnector
impl Unpin for HttpConnector
impl UnsafeUnpin for HttpConnector
impl !UnwindSafe for HttpConnector
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more