pub struct HoprEncoder<Chain, S, T> { /* private fields */ }Expand description
Default encoder implementation for HOPR packets.
Implementations§
Source§impl<Chain, S, T> HoprEncoder<Chain, S, T>
impl<Chain, S, T> HoprEncoder<Chain, S, T>
Sourcepub fn new(
chain_key: ChainKeypair,
chain_api: Chain,
surb_store: S,
tracker: T,
channels_dst: Hash,
cfg: HoprCodecConfig,
) -> Self
pub fn new( chain_key: ChainKeypair, chain_api: Chain, surb_store: S, tracker: T, channels_dst: Hash, cfg: HoprCodecConfig, ) -> Self
Creates a new instance of the encoder.
Trait Implementations§
Source§impl<Chain, S, T> PacketEncoder for HoprEncoder<Chain, S, T>where
Chain: ChainKeyOperations + ChainReadChannelOperations + ChainValues + Send + Sync,
S: SurbStore + Send + Sync,
T: TicketTracker + Send + Sync,
impl<Chain, S, T> PacketEncoder for HoprEncoder<Chain, S, T>where
Chain: ChainKeyOperations + ChainReadChannelOperations + ChainValues + Send + Sync,
S: SurbStore + Send + Sync,
T: TicketTracker + Send + Sync,
type Error = HoprProtocolError
Source§fn encode_packet<'life0, 'async_trait, D, Sig>(
&'life0 self,
data: D,
routing: ResolvedTransportRouting,
signals: Sig,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket, Self::Error>> + Send + 'async_trait>>
fn encode_packet<'life0, 'async_trait, D, Sig>( &'life0 self, data: D, routing: ResolvedTransportRouting, signals: Sig, ) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket, Self::Error>> + Send + 'async_trait>>
Source§fn encode_acknowledgement<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: VerifiedAcknowledgement,
peer: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encode_acknowledgement<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: VerifiedAcknowledgement,
peer: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Encodes the given
VerifiedAcknowledgement as an outgoing packet to be sent to the given
peer.Auto Trait Implementations§
impl<Chain, S, T> Freeze for HoprEncoder<Chain, S, T>
impl<Chain, S, T> RefUnwindSafe for HoprEncoder<Chain, S, T>
impl<Chain, S, T> Send for HoprEncoder<Chain, S, T>
impl<Chain, S, T> Sync for HoprEncoder<Chain, S, T>
impl<Chain, S, T> Unpin for HoprEncoder<Chain, S, T>
impl<Chain, S, T> UnwindSafe for HoprEncoder<Chain, S, T>
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