pub trait DeserializeResponse: Send + Sync + Debug {
    // Required method
    fn deserialize_nonstreaming(
        &self,
        response: &HttpResponse,
    ) -> Result<Output, OrchestratorError<Error>>;

    // Provided method
    fn deserialize_streaming(
        &self,
        response: &mut HttpResponse,
    ) -> Option<Result<Output, OrchestratorError<Error>>> { ... }
}
Available on crate feature client only.
Expand description

Deserialization implementation that converts an HttpResponse into an Output or Error.

Required Methods§

source

fn deserialize_nonstreaming( &self, response: &HttpResponse, ) -> Result<Output, OrchestratorError<Error>>

Deserialize the entire response including its body into an output or error.

Provided Methods§

source

fn deserialize_streaming( &self, response: &mut HttpResponse, ) -> Option<Result<Output, OrchestratorError<Error>>>

For streaming requests, deserializes the response headers.

The orchestrator will call deserialize_streaming first, and if it returns None, then it will continue onto deserialize_nonstreaming. This method should only be implemented for streaming requests where the streaming response body needs to be a part of the deserialized output.

Implementors§