pub struct StreamResponse {
pub status: u16,
pub headers: Vec<(String, String)>,
pub attempts: u32,
/* private fields */
}Fields§
§status: u16§headers: Vec<(String, String)>§attempts: u32Implementations§
Source§impl StreamResponse
impl StreamResponse
pub fn header(&self, name: &str) -> Option<&str>
Sourcepub fn header_all<'a>(
&'a self,
name: &str,
) -> impl Iterator<Item = &'a str> + 'a
pub fn header_all<'a>( &'a self, name: &str, ) -> impl Iterator<Item = &'a str> + 'a
Every value of a repeated header, in order; see Response::header_all.
Sourcepub fn copy_to<W: Write>(
self,
writer: &mut W,
max_bytes: u64,
progress: impl FnMut(u64),
) -> Result<u64, HttpError>
pub fn copy_to<W: Write>( self, writer: &mut W, max_bytes: u64, progress: impl FnMut(u64), ) -> Result<u64, HttpError>
Copy the body into writer, at most max_bytes in total, calling progress with the
running byte count after each chunk. A body over the cap fails with
HttpError::BodyTooLarge; bytes already written stay written. Returns the total.
pub fn into_reader(self) -> Box<dyn Read + Send>
Auto Trait Implementations§
impl !RefUnwindSafe for StreamResponse
impl !Sync for StreamResponse
impl !UnwindSafe for StreamResponse
impl Freeze for StreamResponse
impl Send for StreamResponse
impl Unpin for StreamResponse
impl UnsafeUnpin for StreamResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more