pub struct StubPathResolver {
pub(crate) key_addr_map: BiMap<OffchainPublicKey, Address>,
pub(crate) channels: Vec<ChannelEntry>,
}Expand description
Minimal stub for [PathAddressResolver], using the same BiMap lookups
as the MockPathResolver in transport/protocol/tests/common/mod.rs.
Fields§
§key_addr_map: BiMap<OffchainPublicKey, Address>§channels: Vec<ChannelEntry>Implementations§
Source§impl StubPathResolver
impl StubPathResolver
Sourcepub fn from_chain_api(api: &StubChainApi) -> Self
pub fn from_chain_api(api: &StubChainApi) -> Self
Creates a new resolver sharing key/channel data with the given StubChainApi.
Trait Implementations§
Source§impl PathAddressResolver for StubPathResolver
impl PathAddressResolver for StubPathResolver
Source§fn resolve_transport_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_transport_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve [
OffchainPublicKey] from the given [Address]Source§fn resolve_chain_address<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_chain_address<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve [
Address] from the given [OffchainPublicKey]Source§fn get_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
src: &'life1 Address,
dst: &'life2 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
src: &'life1 Address,
dst: &'life2 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve [
ChannelEntry] based on the given src and dst addresses.Auto Trait Implementations§
impl Freeze for StubPathResolver
impl RefUnwindSafe for StubPathResolver
impl Send for StubPathResolver
impl Sync for StubPathResolver
impl Unpin for StubPathResolver
impl UnwindSafe for StubPathResolver
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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