pub trait ClientReq<CustErr>: Sized {
type FormData;
// Required methods
fn try_new_get(
path: &str,
content_type: &str,
accepts: &str,
query: &str,
) -> Result<Self, ServerFnError<CustErr>>;
fn try_new_post(
path: &str,
content_type: &str,
accepts: &str,
body: String,
) -> Result<Self, ServerFnError<CustErr>>;
fn try_new_post_bytes(
path: &str,
content_type: &str,
accepts: &str,
body: Bytes,
) -> Result<Self, ServerFnError<CustErr>>;
fn try_new_post_form_data(
path: &str,
accepts: &str,
content_type: &str,
body: Self::FormData,
) -> Result<Self, ServerFnError<CustErr>>;
fn try_new_multipart(
path: &str,
accepts: &str,
body: Self::FormData,
) -> Result<Self, ServerFnError<CustErr>>;
fn try_new_streaming(
path: &str,
accepts: &str,
content_type: &str,
body: impl Stream<Item = Bytes> + Send + 'static,
) -> Result<Self, ServerFnError<CustErr>>;
}
Expand description
Represents a request as made by the client.
Required Associated Types§
Required Methods§
Sourcefn try_new_get(
path: &str,
content_type: &str,
accepts: &str,
query: &str,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_get( path: &str, content_type: &str, accepts: &str, query: &str, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new GET
request.
Sourcefn try_new_post(
path: &str,
content_type: &str,
accepts: &str,
body: String,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_post( path: &str, content_type: &str, accepts: &str, body: String, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new POST
request with a text body.
Sourcefn try_new_post_bytes(
path: &str,
content_type: &str,
accepts: &str,
body: Bytes,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_post_bytes( path: &str, content_type: &str, accepts: &str, body: Bytes, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new POST
request with a binary body.
Sourcefn try_new_post_form_data(
path: &str,
accepts: &str,
content_type: &str,
body: Self::FormData,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_post_form_data( path: &str, accepts: &str, content_type: &str, body: Self::FormData, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new POST
request with form data as the body.
Sourcefn try_new_multipart(
path: &str,
accepts: &str,
body: Self::FormData,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_multipart( path: &str, accepts: &str, body: Self::FormData, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new POST
request with a multipart body.
Sourcefn try_new_streaming(
path: &str,
accepts: &str,
content_type: &str,
body: impl Stream<Item = Bytes> + Send + 'static,
) -> Result<Self, ServerFnError<CustErr>>
fn try_new_streaming( path: &str, accepts: &str, content_type: &str, body: impl Stream<Item = Bytes> + Send + 'static, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to construct a new POST
request with a streaming body.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.