Struct jsonrpsee_core::client::RequestIdManager
source · pub struct RequestIdManager { /* private fields */ }
Expand description
Keep track of request IDs.
Implementations§
source§impl RequestIdManager
impl RequestIdManager
sourcepub fn new(limit: usize, id_kind: IdKind) -> Self
pub fn new(limit: usize, id_kind: IdKind) -> Self
Create a new RequestIdGuard
with the provided concurrency limit.
sourcepub fn next_request_id(&self) -> Result<RequestIdGuard<Id<'static>>, Error>
pub fn next_request_id(&self) -> Result<RequestIdGuard<Id<'static>>, Error>
Attempts to get the next request ID.
Fails if request limit has been exceeded.
sourcepub fn next_request_two_ids(
&self
) -> Result<RequestIdGuard<(Id<'static>, Id<'static>)>, Error>
pub fn next_request_two_ids( &self ) -> Result<RequestIdGuard<(Id<'static>, Id<'static>)>, Error>
Attempts to get fetch two ids (used for subscriptions) but only occupy one slot in the request guard.
Fails if request limit has been exceeded.
sourcepub fn as_id_kind(&self) -> IdKind
pub fn as_id_kind(&self) -> IdKind
Get a handle to the IdKind
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for RequestIdManager
impl Send for RequestIdManager
impl Sync for RequestIdManager
impl Unpin for RequestIdManager
impl UnwindSafe for RequestIdManager
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