pub(crate) struct Streams<B, P>where
P: Peer,{
inner: Arc<Mutex<Inner>>,
send_buffer: Arc<SendBuffer<B>>,
_p: PhantomData<P>,
}
Fields§
§inner: Arc<Mutex<Inner>>
Holds most of the connection and stream related state for processing HTTP/2 frames associated with streams.
send_buffer: Arc<SendBuffer<B>>
This is the queue of frames to be written to the wire. This is split out
to avoid requiring a B
generic on all public API types even if B
is
not technically required.
Currently, splitting this out requires a second Arc
+ Mutex
.
However, it should be possible to avoid this duplication with a little
bit of unsafe code. This optimization has been postponed until it has
been shown to be necessary.
_p: PhantomData<P>
Implementations§
source§impl<B, P> Streams<B, P>
impl<B, P> Streams<B, P>
pub fn new(config: Config) -> Self
pub fn set_target_connection_window_size( &mut self, size: u32, ) -> Result<(), Reason>
pub fn next_incoming(&mut self) -> Option<StreamRef<B>>
pub fn send_pending_refusal<T>(
&mut self,
cx: &mut Context<'_>,
dst: &mut Codec<T, Prioritized<B>>,
) -> Poll<Result<()>>where
T: AsyncWrite + Unpin,
pub fn clear_expired_reset_streams(&mut self)
pub fn poll_complete<T>(
&mut self,
cx: &mut Context<'_>,
dst: &mut Codec<T, Prioritized<B>>,
) -> Poll<Result<()>>where
T: AsyncWrite + Unpin,
pub fn apply_remote_settings(&mut self, frame: &Settings) -> Result<(), Error>
pub fn apply_local_settings(&mut self, frame: &Settings) -> Result<(), Error>
pub fn send_request( &mut self, request: Request<()>, end_of_stream: bool, pending: Option<&OpaqueStreamRef>, ) -> Result<(StreamRef<B>, bool), SendError>
pub(crate) fn is_extended_connect_protocol_enabled(&self) -> bool
source§impl<B> Streams<B, Peer>where
B: Buf,
impl<B> Streams<B, Peer>where
B: Buf,
pub fn poll_pending_open( &mut self, cx: &Context<'_>, pending: Option<&OpaqueStreamRef>, ) -> Poll<Result<(), Error>>
source§impl<B, P> Streams<B, P>where
P: Peer,
impl<B, P> Streams<B, P>where
P: Peer,
pub fn as_dyn(&self) -> DynStreams<'_, B>
sourcepub fn recv_eof(&mut self, clear_pending_accept: bool) -> Result<(), ()>
pub fn recv_eof(&mut self, clear_pending_accept: bool) -> Result<(), ()>
This function is safe to call multiple times.
A Result
is returned to avoid panicking if the mutex is poisoned.
pub(crate) fn max_send_streams(&self) -> usize
pub(crate) fn max_recv_streams(&self) -> usize
pub fn has_streams(&self) -> bool
pub fn has_streams_or_other_references(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<B, P> Freeze for Streams<B, P>
impl<B, P> RefUnwindSafe for Streams<B, P>where
P: RefUnwindSafe,
impl<B, P> Send for Streams<B, P>
impl<B, P> Sync for Streams<B, P>
impl<B, P> Unpin for Streams<B, P>where
P: Unpin,
impl<B, P> UnwindSafe for Streams<B, P>where
P: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)