[−][src]Struct interledger_service_util::RateLimitService
Rate Limit Service
Incoming Service responsible for rejecting requests by users who have reached their account's rate limit. Talks with the associated Store in order to figure out and set the rate limits per account. This service does packet based limiting and amount based limiting.
Forwards everything else.
Requires a RateLimitAccount
and a RateLimitStore
.
It is an IncomingService.
Methods
impl<S, I, A> RateLimitService<S, I, A> where
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync,
I: IncomingService<A> + Clone + Send + Sync,
A: RateLimitAccount + Sync,
[src]
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync,
I: IncomingService<A> + Clone + Send + Sync,
A: RateLimitAccount + Sync,
Trait Implementations
impl<S: Clone, I: Clone, A: Clone> Clone for RateLimitService<S, I, A>
[src]
fn clone(&self) -> RateLimitService<S, I, A>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S, I, A> IncomingService<A> for RateLimitService<S, I, A> where
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
A: RateLimitAccount + Sync + 'static,
[src]
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
A: RateLimitAccount + Sync + 'static,
type Future = BoxedIlpFuture
fn handle_request(&mut self, request: IncomingRequest<A>) -> Self::Future
[src]
On receiving a request:
- Apply rate limit based on the sender of the request and the amount in the prepare packet in the request
- If no limits were hit forward the request
- If it succeeds, OK
- If the request forwarding failed, the client should not be charged towards their throughput limit, so they are refunded, and return a reject
- If the limit was hit, return a reject with the appropriate ErrorCode.
Auto Trait Implementations
impl<S, I, A> Send for RateLimitService<S, I, A> where
A: Send,
I: Send,
S: Send,
A: Send,
I: Send,
S: Send,
impl<S, I, A> Sync for RateLimitService<S, I, A> where
A: Sync,
I: Sync,
S: Sync,
A: Sync,
I: Sync,
S: Sync,
impl<S, I, A> Unpin for RateLimitService<S, I, A> where
A: Unpin,
I: Unpin,
S: Unpin,
A: Unpin,
I: Unpin,
S: Unpin,
impl<S, I, A> UnwindSafe for RateLimitService<S, I, A> where
A: UnwindSafe,
I: UnwindSafe,
S: UnwindSafe,
A: UnwindSafe,
I: UnwindSafe,
S: UnwindSafe,
impl<S, I, A> RefUnwindSafe for RateLimitService<S, I, A> where
A: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
A: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,