[−][src]Struct interledger_service_util::BalanceService
Balance Service
Responsible for managing the balances of the account and the interaction with the Settlement Engine
Requires an Account
and a BalanceStore
Methods
impl<S, O, A> BalanceService<S, O, A> where
S: AddressStore + BalanceStore<Account = A> + SettlementStore<Account = A>,
O: OutgoingService<A>,
A: Account + SettlementAccount,
[src]
S: AddressStore + BalanceStore<Account = A> + SettlementStore<Account = A>,
O: OutgoingService<A>,
A: Account + SettlementAccount,
Trait Implementations
impl<S: Clone, O: Clone, A: Clone> Clone for BalanceService<S, O, A>
[src]
fn clone(&self) -> BalanceService<S, O, A>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S, O, A> OutgoingService<A> for BalanceService<S, O, A> where
S: AddressStore + BalanceStore<Account = A> + SettlementStore<Account = A> + Clone + Send + Sync + 'static,
O: OutgoingService<A> + Send + Clone + 'static,
A: SettlementAccount + 'static,
[src]
S: AddressStore + BalanceStore<Account = A> + SettlementStore<Account = A> + Clone + Send + Sync + 'static,
O: OutgoingService<A> + Send + Clone + 'static,
A: SettlementAccount + 'static,
type Future = BoxedIlpFuture
fn send_request(
&mut self,
request: OutgoingRequest<A>
) -> Box<dyn Future<Item = Fulfill, Error = Reject> + Send>
[src]
&mut self,
request: OutgoingRequest<A>
) -> Box<dyn Future<Item = Fulfill, Error = Reject> + Send>
On send message:
- Calls
store.update_balances_for_prepare
with the prepare. If it fails, it replies with a reject - Tries to forward the request:
- If it returns a fullfil, calls
store.update_balances_for_fulfill
and replies with the fulfill INDEPENDENTLY of if the call suceeds or fails. This makes asendMoney
call if the fulfill puts the account's balance over thesettle_threshold
- if it returns an reject calls
store.update_balances_for_reject
and replies with the fulfill INDEPENDENTLY of if the call suceeds or fails
- If it returns a fullfil, calls
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<S, O, A> Send for BalanceService<S, O, A> where
A: Send,
O: Send,
S: Send,
A: Send,
O: Send,
S: Send,
impl<S, O, A> Sync for BalanceService<S, O, A> where
A: Sync,
O: Sync,
S: Sync,
A: Sync,
O: Sync,
S: Sync,
impl<S, O, A> Unpin for BalanceService<S, O, A> where
A: Unpin,
O: Unpin,
S: Unpin,
A: Unpin,
O: Unpin,
S: Unpin,
impl<S, O, A> !UnwindSafe for BalanceService<S, O, A>
impl<S, O, A> !RefUnwindSafe for BalanceService<S, O, A>
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>,