[][src]Trait interledger_service::OutgoingService

pub trait OutgoingService<A: Account> {
    type Future: Future<Item = Fulfill, Error = Reject> + Send + 'static;
    fn send_request(&mut self, request: OutgoingRequest<A>) -> Self::Future;

    fn wrap<F, R>(self, f: F) -> WrappedService<F, Self, A>
    where
        F: Fn(OutgoingRequest<A>, Self) -> R,
        R: Future<Item = Fulfill, Error = Reject> + Send + 'static,
        Self: Clone + Sized
, { ... } }

Core service trait for sending OutgoingRequests that asynchronously returns an ILP Fulfill or Reject packet.

Associated Types

type Future: Future<Item = Fulfill, Error = Reject> + Send + 'static

Loading content...

Required methods

fn send_request(&mut self, request: OutgoingRequest<A>) -> Self::Future

Loading content...

Provided methods

fn wrap<F, R>(self, f: F) -> WrappedService<F, Self, A> where
    F: Fn(OutgoingRequest<A>, Self) -> R,
    R: Future<Item = Fulfill, Error = Reject> + Send + 'static,
    Self: Clone + Sized

Wrap the given service such that the provided function will be called to handle each request. That function can return immediately, modify the request before passing it on, and/or handle the result of calling the inner service.

Loading content...

Implementors

impl<F, A, B> OutgoingService<A> for ServiceFn<F, A> where
    A: Account,
    B: IntoFuture<Item = Fulfill, Error = Reject>,
    <B as IntoFuture>::Future: Send + 'static,
    F: FnMut(OutgoingRequest<A>) -> B, 
[src]

type Future = BoxedIlpFuture

impl<F, IO, A, R> OutgoingService<A> for WrappedService<F, IO, A> where
    F: Fn(OutgoingRequest<A>, IO) -> R,
    IO: OutgoingService<A> + Clone,
    A: Account,
    R: Future<Item = Fulfill, Error = Reject> + Send + 'static, 
[src]

type Future = R

Loading content...