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
.