[−][src]Struct interledger_service_util::ExpiryShortenerService
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]
fn clone(&self) -> ExpiryShortenerService<O>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<O, A> OutgoingService<A> for ExpiryShortenerService<O> where
O: OutgoingService<A>,
A: RoundTripTimeAccount,
[src]
O: OutgoingService<A>,
A: RoundTripTimeAccount,
type Future = O::Future
fn send_request(&mut self, request: OutgoingRequest<A>) -> Self::Future
[src]
On send request:
- Get the sender and receiver's roundtrip time (default 1000ms)
- Reduce the packet's expiry by that amount
- Ensure that the packet expiry does not exceed the maximum expiry duration
- Forward the request
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,
[src]
F: Fn(OutgoingRequest<A>, Self) -> R,
R: Future<Item = Fulfill, Error = Reject> + Send + 'static,
Self: Clone,
Auto Trait Implementations
impl<O> Send for ExpiryShortenerService<O> where
O: Send,
O: Send,
impl<O> Sync for ExpiryShortenerService<O> where
O: Sync,
O: Sync,
impl<O> Unpin for ExpiryShortenerService<O> where
O: Unpin,
O: Unpin,
impl<O> UnwindSafe for ExpiryShortenerService<O> where
O: UnwindSafe,
O: UnwindSafe,
impl<O> RefUnwindSafe for ExpiryShortenerService<O> where
O: RefUnwindSafe,
O: 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>,