[−][src]Trait interledger::service::IncomingService
Core service trait for handling IncomingRequests that asynchronously returns an ILP Fulfill or Reject packet.
Associated Types
Loading content...Required methods
fn handle_request(&mut self, request: IncomingRequest<A>) -> Self::Future
Implementors
impl<F, A, B> IncomingService<A> for ServiceFn<F, A> where
A: Account,
B: IntoFuture<Item = Fulfill, Error = Reject>,
F: FnMut(IncomingRequest<A>) -> B,
<B as IntoFuture>::Future: Send,
<B as IntoFuture>::Future: 'static,
[src]
A: Account,
B: IntoFuture<Item = Fulfill, Error = Reject>,
F: FnMut(IncomingRequest<A>) -> B,
<B as IntoFuture>::Future: Send,
<B as IntoFuture>::Future: 'static,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <ServiceFn<F, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <ServiceFn<F, A> as IncomingService<A>>::Future
impl<I, A> IncomingService<A> for IldcpService<I, A> where
A: Account,
I: IncomingService<A>,
[src]
A: Account,
I: IncomingService<A>,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <IldcpService<I, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <IldcpService<I, A> as IncomingService<A>>::Future
impl<I, A> IncomingService<A> for SettlementMessageService<I, A> where
A: SettlementAccount,
I: IncomingService<A> + Send,
[src]
A: SettlementAccount,
I: IncomingService<A> + Send,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <SettlementMessageService<I, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <SettlementMessageService<I, A> as IncomingService<A>>::Future
impl<I, O, S, A> IncomingService<A> for CcpRouteManager<I, O, S, A> where
A: CcpRoutingAccount + Send + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
O: OutgoingService<A> + Clone + Send + Sync + 'static,
S: AddressStore + RouteManagerStore<Account = A> + Clone + Send + Sync + 'static,
[src]
A: CcpRoutingAccount + Send + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
O: OutgoingService<A> + Clone + Send + Sync + 'static,
S: AddressStore + RouteManagerStore<Account = A> + Clone + Send + Sync + 'static,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <CcpRouteManager<I, O, S, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <CcpRouteManager<I, O, S, A> as IncomingService<A>>::Future
Handle the IncomingRequest if it is a CCP protocol message or pass it on to the next handler if not
impl<I, S, A> IncomingService<A> for EchoService<I, S, A> where
A: Account,
I: IncomingService<A>,
S: AddressStore,
[src]
A: Account,
I: IncomingService<A>,
S: AddressStore,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <EchoService<I, S, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <EchoService<I, S, A> as IncomingService<A>>::Future
impl<I, S, A> IncomingService<A> for MaxPacketAmountService<I, S> where
A: MaxPacketAmountAccount,
I: IncomingService<A>,
S: AddressStore,
[src]
A: MaxPacketAmountAccount,
I: IncomingService<A>,
S: AddressStore,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <MaxPacketAmountService<I, S> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <MaxPacketAmountService<I, S> as IncomingService<A>>::Future
On receive request:
- if request.prepare.amount <= request.from.max_packet_amount forward the request, else error
impl<I, S, A> IncomingService<A> for ValidatorService<I, S, A> where
A: Account,
I: IncomingService<A>,
S: AddressStore,
[src]
A: Account,
I: IncomingService<A>,
S: AddressStore,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <ValidatorService<I, S, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <ValidatorService<I, S, A> as IncomingService<A>>::Future
On receiving a request:
- If the prepare packet in the request is not expired, forward it, otherwise return a reject
impl<S, I, A> IncomingService<A> for RateLimitService<S, I, A> where
A: RateLimitAccount + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync + 'static,
[src]
A: RateLimitAccount + Sync + 'static,
I: IncomingService<A> + Clone + Send + Sync + 'static,
S: AddressStore + RateLimitStore<Account = A> + Clone + Send + Sync + 'static,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<A>
) -> <RateLimitService<S, I, A> as IncomingService<A>>::Future
[src]
&mut self,
request: IncomingRequest<A>
) -> <RateLimitService<S, I, A> as IncomingService<A>>::Future
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.
impl<S, O> IncomingService<<S as AccountStore>::Account> for Router<S, O> where
O: OutgoingService<<S as AccountStore>::Account> + Clone + Send + 'static,
S: AddressStore + RouterStore,
[src]
O: OutgoingService<<S as AccountStore>::Account> + Clone + Send + 'static,
S: AddressStore + RouterStore,
type Future = Box<dyn Future<Item = Fulfill, Error = Reject> + 'static + Send>
fn handle_request(
&mut self,
request: IncomingRequest<<S as AccountStore>::Account>
) -> <Router<S, O> as IncomingService<<S as AccountStore>::Account>>::Future
[src]
&mut self,
request: IncomingRequest<<S as AccountStore>::Account>
) -> <Router<S, O> as IncomingService<<S as AccountStore>::Account>>::Future
Figures out the next node to pass the received Prepare packet to.
Firstly, it checks if there is a direct path for that account and use that. If not it scans through the routing table and checks if the route prefix matches the prepare packet's destination or if it's a catch-all address (i.e. empty prefix)