pub struct StreamManager { /* private fields */ }Expand description
Manages stream concurrency and queuing.
Implementations§
Source§impl StreamManager
impl StreamManager
Sourcepub fn new(connection: Arc<Connection>, max_concurrent: u32) -> Arc<Self>
pub fn new(connection: Arc<Connection>, max_concurrent: u32) -> Arc<Self>
Create a new stream manager.
Sourcepub fn set_max_concurrent(&self, max: u32)
pub fn set_max_concurrent(&self, max: u32)
Update the max concurrent streams limit.
Sourcepub fn active_count(&self) -> u32
pub fn active_count(&self) -> u32
Get current active stream count.
Sourcepub async fn request_stream(
self: &Arc<Self>,
request: SwapQuoteRequest,
) -> Result<QuoteStream, TitanClientError>
pub async fn request_stream( self: &Arc<Self>, request: SwapQuoteRequest, ) -> Result<QuoteStream, TitanClientError>
Request a new stream. May wait in queue if at concurrency limit.
Sourcepub fn stream_ended(&self)
pub fn stream_ended(&self)
Called when a stream ends to free up a slot.
Auto Trait Implementations§
impl !Freeze for StreamManager
impl !RefUnwindSafe for StreamManager
impl Send for StreamManager
impl Sync for StreamManager
impl Unpin for StreamManager
impl !UnwindSafe for StreamManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more