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_ids(
&self,
len: usize
) -> Result<RequestIdGuard<Vec<Id<'static>>>, Error>
pub fn next_request_ids(
&self,
len: usize
) -> Result<RequestIdGuard<Vec<Id<'static>>>, Error>
Attempts to get the n
number next IDs that only counts as one request.
Fails if request limit has been exceeded.