pub trait Response: 'static + Send {
// Required methods
fn from_result<T: Serialize, C: Debug + Copy + Sync + Send + 'static + Into<u16>>(
ret: Result<T, C>,
) -> Self;
fn new(status: StatusCode) -> Self;
fn insert_header(&mut self, name: HeaderName, value: HeaderValue);
fn set_content_type(&mut self, content_type: &str) -> HttpResult<()>;
fn set_body(&mut self, body: Vec<u8>);
fn set_body_read<R: AsyncRead + Send + Unpin + 'static>(
&mut self,
reader: R,
);
}Required Methods§
fn from_result<T: Serialize, C: Debug + Copy + Sync + Send + 'static + Into<u16>>( ret: Result<T, C>, ) -> Self
fn new(status: StatusCode) -> Self
fn insert_header(&mut self, name: HeaderName, value: HeaderValue)
fn set_content_type(&mut self, content_type: &str) -> HttpResult<()>
fn set_body(&mut self, body: Vec<u8>)
fn set_body_read<R: AsyncRead + Send + Unpin + 'static>(&mut self, reader: R)
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.