[−][src]Struct fastly::handle::StreamingBodyHandle
A low-level interface to a streaming HTTP body.
The interface to this type is very similar to BodyHandle
, however it is write-only, and can
only be created as a result of calling
ResponseHandle::send_to_client()
or
RequestHandle::send_async_streaming()
.
This type implements Write
to write to the end of a body. Note that these operations are
unbuffered, unlike the same operations on the higher-level Body
type.
A streaming body will be automatically closed when it goes out of scope, or when it is passed to
drop()
.
Implementations
impl StreamingBodyHandle
[src]
pub fn append(&mut self, other: BodyHandle)
[src]
Append another body onto the end of this body.
This operation is performed in amortized constant time, and so should always be preferred to reading an entire body and then writing the same contents to another body.
The other body will no longer be valid after this call.
Examples
let mut streaming_body = response_handle.stream_to_client(BodyHandle::new()); streaming_body.append(other_body);
pub fn write_bytes(&mut self, bytes: &[u8]) -> usize
[src]
Write a slice of bytes to the end of this streaming body, and the number of bytes written.
Examples
let mut streaming_body = response_handle.stream_to_client(BodyHandle::new()); streaming_body.write_bytes(&[0, 1, 2, 3]);
pub fn write_str(&mut self, string: &str) -> usize
[src]
Write a string slice to the end of this streaming body, and the number of bytes written.
Examples
let mut streaming_body = response_handle.stream_to_client(BodyHandle::new()); streaming_body.write_str("woof woof");
Trait Implementations
impl Debug for StreamingBodyHandle
[src]
impl Drop for StreamingBodyHandle
[src]
impl Eq for StreamingBodyHandle
[src]
impl From<StreamingBodyHandle> for StreamingBody
[src]
pub fn from(handle: StreamingBodyHandle) -> Self
[src]
impl Hash for StreamingBodyHandle
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<StreamingBodyHandle> for StreamingBodyHandle
[src]
pub fn eq(&self, other: &StreamingBodyHandle) -> bool
[src]
pub fn ne(&self, other: &StreamingBodyHandle) -> bool
[src]
impl StructuralEq for StreamingBodyHandle
[src]
impl StructuralPartialEq for StreamingBodyHandle
[src]
impl Write for StreamingBodyHandle
[src]
pub fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
pub fn flush(&mut self) -> Result<()>
[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>
1.36.0[src]
pub fn is_write_vectored(&self) -> bool
[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for StreamingBodyHandle
[src]
impl Send for StreamingBodyHandle
[src]
impl Sync for StreamingBodyHandle
[src]
impl Unpin for StreamingBodyHandle
[src]
impl UnwindSafe for StreamingBodyHandle
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,