[][src]Struct interledger_service_util::ValidatorService

pub struct ValidatorService<IO, S, A> { /* fields omitted */ }

Validator Service

Incoming or Outgoing Service responsible for rejecting timed out requests and checking that fulfillments received match the execution_condition from the original Prepare packets. Forwards everything else.

Methods

impl<I, S, A> ValidatorService<I, S, A> where
    I: IncomingService<A>,
    S: AddressStore,
    A: Account
[src]

pub fn incoming(store: S, next: I) -> Self[src]

impl<O, S, A> ValidatorService<O, S, A> where
    O: OutgoingService<A>,
    S: AddressStore,
    A: Account
[src]

pub fn outgoing(store: S, next: O) -> Self[src]

Trait Implementations

impl<IO: Clone, S: Clone, A: Clone> Clone for ValidatorService<IO, S, A>[src]

impl<I, S, A> IncomingService<A> for ValidatorService<I, S, A> where
    I: IncomingService<A>,
    S: AddressStore,
    A: Account
[src]

type Future = BoxedIlpFuture

fn handle_request(&mut self, request: IncomingRequest<A>) -> Self::Future[src]

On receiving a request:

  1. If the prepare packet in the request is not expired, forward it, otherwise return a reject

impl<O, S, A> OutgoingService<A> for ValidatorService<O, S, A> where
    O: OutgoingService<A>,
    S: AddressStore,
    A: Account
[src]

type Future = BoxedIlpFuture

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

On sending a request:

  1. If the outgoing packet has expired, return a reject with the appropriate ErrorCode
  2. Tries to forward the request
    • If no response is received before the prepare packet's expiration, it assumes that the outgoing request has timed out.
    • If no timeout occurred, but still errored it will just return the reject
    • If the forwarding is successful, it should receive a fulfill packet. Depending on if the hash of the fulfillment condition inside the fulfill is a preimage of the condition of the prepare:
      • return the fulfill if it matches
      • otherwise reject

Auto Trait Implementations

impl<IO, S, A> Send for ValidatorService<IO, S, A> where
    A: Send,
    IO: Send,
    S: Send

impl<IO, S, A> Sync for ValidatorService<IO, S, A> where
    A: Sync,
    IO: Sync,
    S: Sync

impl<IO, S, A> Unpin for ValidatorService<IO, S, A> where
    A: Unpin,
    IO: Unpin,
    S: Unpin

impl<IO, S, A> UnwindSafe for ValidatorService<IO, S, A> where
    A: UnwindSafe,
    IO: UnwindSafe,
    S: UnwindSafe

impl<IO, S, A> RefUnwindSafe for ValidatorService<IO, S, A> where
    A: RefUnwindSafe,
    IO: RefUnwindSafe,
    S: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err