[−][src]Struct interledger_router::Router
Interledger Router
The Router
implements an incoming service and includes an outgoing service.
It determines the next account to forward to and passes it on.
Both incoming and outgoing services can respond to requests but many just pass the request on.
The Router
requires a RouterStore
, which keeps track of the entire routing table. Once the Router
receives a Prepare, it checks its destination and if it finds it in the routing table
The router implements the IncomingService trait and uses the routing table
to determine the to
(or "next hop") Account for the given request.
Note that the router does not:
- apply exchange rates or fees to the Prepare packet
- adjust account balances
- reduce the Prepare packet's expiry
That is done by OutgoingServices.
Methods
impl<S, O> Router<S, O> where
S: RouterStore,
O: OutgoingService<S::Account>,
[src]
S: RouterStore,
O: OutgoingService<S::Account>,
Trait Implementations
impl<S: Clone, O: Clone> Clone for Router<S, O>
[src]
impl<S, O> IncomingService<<S as AccountStore>::Account> for Router<S, O> where
S: AddressStore + RouterStore,
O: OutgoingService<S::Account> + Clone + Send + 'static,
[src]
S: AddressStore + RouterStore,
O: OutgoingService<S::Account> + Clone + Send + 'static,
type Future = BoxedIlpFuture
fn handle_request(
&mut self,
request: IncomingRequest<S::Account>
) -> Self::Future
[src]
&mut self,
request: IncomingRequest<S::Account>
) -> Self::Future
Figures out the next node to pass the received Prepare packet to.
Firstly, it checks if there is a direct path for that account and use that. If not it scans through the routing table and checks if the route prefix matches the prepare packet's destination or if it's a catch-all address (i.e. empty prefix)
Auto Trait Implementations
impl<S, O> Send for Router<S, O> where
O: Send,
S: Send,
O: Send,
S: Send,
impl<S, O> Unpin for Router<S, O> where
O: Unpin,
S: Unpin,
O: Unpin,
S: Unpin,
impl<S, O> Sync for Router<S, O> where
O: Sync,
S: Sync,
O: Sync,
S: Sync,
impl<S, O> RefUnwindSafe for Router<S, O> where
O: RefUnwindSafe,
S: RefUnwindSafe,
O: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, O> UnwindSafe for Router<S, O> where
O: UnwindSafe,
S: UnwindSafe,
O: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> From<T> for 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,