Skip to main content

GetBinary

Trait GetBinary 

Source
pub trait GetBinary:
    Get
    + Sync
    + Send {
    // Provided method
    fn get_response_bytes(
        &self,
        client: &Client,
        base_url: &str,
        key: &str,
    ) -> impl Future<Output = Result<Vec<u8>, OapiError>> + Send + Sync { ... }
}
Expand description

Trait for GET requests whose response body is binary rather than JSON.

Endpoints such as GET /files/{file_id}/content return the raw file contents instead of a JSON object, so the body is returned as raw bytes.

Provided Methods§

Source

fn get_response_bytes( &self, client: &Client, base_url: &str, key: &str, ) -> impl Future<Output = Result<Vec<u8>, OapiError>> + Send + Sync

Sends a GET request and returns the raw response body bytes.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§