pub struct SequentialSwapStrategyEncoder { /* private fields */ }Expand description
Represents the encoder for a swap strategy which supports sequential swaps.
§Fields
swap_encoder_registry: SwapEncoderRegistry, containing all possible swap encodersfunction_signature: String, the signature for the swap function in the router contractnative_address: Address of the chain’s native tokenwrapped_address: Address of the chain’s wrapped tokenrouter_address: Address of the router to be used to execute swapssequential_swap_validator: SequentialSwapValidator, responsible for checking validity of sequential swap solutionstransfer_optimization: TransferOptimization, responsible for optimizing the token transfers
Implementations§
Source§impl SequentialSwapStrategyEncoder
impl SequentialSwapStrategyEncoder
pub fn new( chain: Chain, swap_encoder_registry: SwapEncoderRegistry, user_transfer_type: UserTransferType, router_address: Bytes, ) -> Result<Self, EncodingError>
Trait Implementations§
Source§impl Clone for SequentialSwapStrategyEncoder
impl Clone for SequentialSwapStrategyEncoder
Source§fn clone(&self) -> SequentialSwapStrategyEncoder
fn clone(&self) -> SequentialSwapStrategyEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl StrategyEncoder for SequentialSwapStrategyEncoder
impl StrategyEncoder for SequentialSwapStrategyEncoder
Source§fn encode_strategy(
&self,
solution: &Solution<'_>,
) -> Result<EncodedSolution, EncodingError>
fn encode_strategy( &self, solution: &Solution<'_>, ) -> Result<EncodedSolution, EncodingError>
encode_strategy takes a Solution, which contains all the necessary information about
the swaps to be performed, and encodes it into a format that can be executed by the router
or executor contracts. Read moreSource§fn get_swap_encoder(
&self,
protocol_system: &str,
) -> Option<&Box<dyn SwapEncoder>>
fn get_swap_encoder( &self, protocol_system: &str, ) -> Option<&Box<dyn SwapEncoder>>
Retrieves the swap encoder for a specific protocol system. Read more
Source§fn clone_box(&self) -> Box<dyn StrategyEncoder>
fn clone_box(&self) -> Box<dyn StrategyEncoder>
Creates a cloned instance of the strategy encoder.
Auto Trait Implementations§
impl !Freeze for SequentialSwapStrategyEncoder
impl !RefUnwindSafe for SequentialSwapStrategyEncoder
impl Send for SequentialSwapStrategyEncoder
impl Sync for SequentialSwapStrategyEncoder
impl Unpin for SequentialSwapStrategyEncoder
impl !UnwindSafe for SequentialSwapStrategyEncoder
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> 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