pub struct SolanaClientRateLimit {
    pub endpoint_amounts: HashMap<RpcRequest, u64>,
    pub ignore_endpoints: HashSet<RpcRequest>,
    pub last_datetime: i64,
    pub interval: i64,
    pub consumed_amount: u64,
    pub maximum_amount: u64,
    pub default_amount_per_endpoint: u64,
}
Expand description

Limit for rates like requests per second or compute units per interval.

Fields

endpoint_amounts: HashMap<RpcRequest, u64>

Map that contains the amount given to each endpoint.

ignore_endpoints: HashSet<RpcRequest>

Set of endpoints ignored by this limit.

last_datetime: i64

The last date this limit was updated.

interval: i64

Interval between rate resets expressed in milliseconds.

consumed_amount: u64

The number of requests or compute units already consumed in the current interval.

maximum_amount: u64

The maximum number of requests or compute units allowed per interval.

default_amount_per_endpoint: u64

The default amount for each endpoint if not specified in endpoint_amounts.

Implementations

Adds a RpcRequest to the map of endpoints to their amounts.

Adds a RpcRequest to the list of ignored endpoints.

Adds all RpcRequest to the list of ignored endpoints.

Checks whether the endpoint can be executed according to the current limits.

Checks whether the endpoints can be executed according to the current limits.

Applies the changes of executing the endpoint.

Applies the changes of executing the endpoints.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more