[][src]Struct interledger_service_util::ExpiryShortenerService

pub struct ExpiryShortenerService<O> { /* fields omitted */ }

Expiry Shortener Service

Each node shortens the Prepare packet's expiry duration before passing it on. Nodes shorten the expiry duration so that even if the packet is fulfilled just before the expiry, they will still have enough time to pass the fulfillment to the previous node before it expires.

This service reduces the expiry time of each packet before forwarding it out. Requires a RoundtripTimeAccount and no store

Methods

impl<O> ExpiryShortenerService<O>[src]

pub fn new(next: O) -> Self[src]

pub fn max_expiry_duration(&mut self, milliseconds: u32) -> &mut Self[src]

Trait Implementations

impl<O: Clone> Clone for ExpiryShortenerService<O>[src]

impl<O, A> OutgoingService<A> for ExpiryShortenerService<O> where
    O: OutgoingService<A>,
    A: RoundTripTimeAccount
[src]

type Future = O::Future

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

On send request:

  1. Get the sender and receiver's roundtrip time (default 1000ms)
  2. Reduce the packet's expiry by that amount
  3. Ensure that the packet expiry does not exceed the maximum expiry duration
  4. Forward the request

Auto Trait Implementations

impl<O> Send for ExpiryShortenerService<O> where
    O: Send

impl<O> Sync for ExpiryShortenerService<O> where
    O: Sync

impl<O> Unpin for ExpiryShortenerService<O> where
    O: Unpin

impl<O> UnwindSafe for ExpiryShortenerService<O> where
    O: UnwindSafe

impl<O> RefUnwindSafe for ExpiryShortenerService<O> where
    O: 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