Skip to main content

FHIRHttpExchange

Trait FHIRHttpExchange 

Source
pub trait FHIRHttpExchange<CTX>: FHIRClient<CTX, OperationOutcomeError> {
    // Required methods
    fn request_with_metadata(
        &self,
        ctx: CTX,
        request: FHIRRequest,
    ) -> impl Future<Output = (Option<HttpResponseMetadata>, Result<FHIRResponse, OperationOutcomeError>)> + Send;
    fn send(
        &self,
        ctx: CTX,
        method: Method,
        url: &str,
    ) -> impl Future<Output = Result<(HttpResponseMetadata, Bytes), OperationOutcomeError>> + Send;
}
Expand description

What a FHIR client over HTTP offers beyond FHIRClient: the status and headers of a response, and requests outside the FHIR interactions.

Required Methods§

Source

fn request_with_metadata( &self, ctx: CTX, request: FHIRRequest, ) -> impl Future<Output = (Option<HttpResponseMetadata>, Result<FHIRResponse, OperationOutcomeError>)> + Send

Sends a FHIR interaction as FHIRClient::request does, also returning the status and headers of its response, or None when no response arrived.

Source

fn send( &self, ctx: CTX, method: Method, url: &str, ) -> impl Future<Output = Result<(HttpResponseMetadata, Bytes), OperationOutcomeError>> + Send

Sends a request that is not a FHIR interaction, such as a poll of an asynchronous request’s status URL, to url: absolute, or relative to the FHIR base URL. A non-success status is a response like any other, not an error. The configured authentication is sent only to the FHIR base URL’s origin, so a URL taken from a response cannot carry the credentials elsewhere.

§Errors

Returns an [OperationOutcomeError] if the URL is invalid or no response arrived.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<CTX: 'static + Send + Sync + Debug + HttpRequestHeaders> FHIRHttpExchange<CTX> for FHIRHttpClient<CTX>