pub struct Router {
pub quoters: Vec<AnyQuoter>,
pub graph: UnGraph<String, String>,
pub token_map: HashMap<String, NodeIndex<u32>>,
/* private fields */
}Fields§
§quoters: Vec<AnyQuoter>§graph: UnGraph<String, String>§token_map: HashMap<String, NodeIndex<u32>>Implementations§
Source§impl Router
impl Router
pub fn get_token_index(&self, token: &AssetIdentifier) -> Option<NodeIndex<u32>>
pub fn get_token_by_index( &self, index: NodeIndex<u32>, ) -> Option<AssetIdentifier>
pub fn add_token(&mut self, token: &AssetIdentifier) -> NodeIndex<u32>
pub fn add_quoter(&mut self, quoter: AnyQuoter)
pub fn to_graphviz(&self) -> String
Sourcepub fn compute(
&self,
input_token: &AssetIdentifier,
output_token: &AssetIdentifier,
) -> Result<Route>
pub fn compute( &self, input_token: &AssetIdentifier, output_token: &AssetIdentifier, ) -> Result<Route>
compute a route given an input and output token
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Router
impl !UnwindSafe for Router
impl Freeze for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnsafeUnpin for Router
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more