pub(crate) struct StreamRef<B> {
opaque: OpaqueStreamRef,
send_buffer: Arc<SendBuffer<B>>,
}
Expand description
Reference to the stream state
Fields§
§opaque: OpaqueStreamRef
§send_buffer: Arc<SendBuffer<B>>
Implementations§
source§impl<B> StreamRef<B>
impl<B> StreamRef<B>
pub fn send_data(&mut self, data: B, end_stream: bool) -> Result<(), UserError>where B: Buf,
pub fn send_trailers(&mut self, trailers: HeaderMap) -> Result<(), UserError>
pub fn send_reset(&mut self, reason: Reason)
pub fn send_response( &mut self, response: Response<()>, end_of_stream: bool ) -> Result<(), UserError>
pub fn send_push_promise( &mut self, request: Request<()> ) -> Result<StreamRef<B>, UserError>
sourcepub fn take_request(&self) -> Request<()>
pub fn take_request(&self) -> Request<()>
Called by the server after the stream is accepted. Given that clients initialize streams by sending HEADERS, the request will always be available.
Panics
This function panics if the request isn’t present.
sourcepub fn is_pending_open(&self) -> bool
pub fn is_pending_open(&self) -> bool
Called by a client to see if the current stream is pending open
sourcepub fn reserve_capacity(&mut self, capacity: u32)
pub fn reserve_capacity(&mut self, capacity: u32)
Request capacity to send data
sourcepub fn poll_capacity(
&mut self,
cx: &Context<'_>
) -> Poll<Option<Result<u32, UserError>>>
pub fn poll_capacity( &mut self, cx: &Context<'_> ) -> Poll<Option<Result<u32, UserError>>>
Request to be notified when the stream’s capacity increases
sourcepub(crate) fn poll_reset(
&mut self,
cx: &Context<'_>,
mode: PollReset
) -> Poll<Result<Reason, Error>>
pub(crate) fn poll_reset( &mut self, cx: &Context<'_>, mode: PollReset ) -> Poll<Result<Reason, Error>>
Request to be notified for if a RST_STREAM
is received for this stream.
pub fn clone_to_opaque(&self) -> OpaqueStreamRef
pub fn stream_id(&self) -> StreamId
Trait Implementations§
Auto Trait Implementations§
impl<B> RefUnwindSafe for StreamRef<B>
impl<B> Send for StreamRef<B>where B: Send,
impl<B> Sync for StreamRef<B>where B: Send,
impl<B> Unpin for StreamRef<B>
impl<B> UnwindSafe for StreamRef<B>
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