pub struct TychoExecutorEncoder { /* private fields */ }Expand description
Represents an encoder for one swap to be executed directly against an Executor.
This is useful when you want to bypass the Tycho Router, use your own Router contract and just need the calldata for a particular swap.
§Fields
swap_encoder_registry: Registry of swap encoders
Implementations§
Source§impl TychoExecutorEncoder
impl TychoExecutorEncoder
pub fn new( swap_encoder_registry: SwapEncoderRegistry, ) -> Result<Self, EncodingError>
Trait Implementations§
Source§impl Clone for TychoExecutorEncoder
impl Clone for TychoExecutorEncoder
Source§fn clone(&self) -> TychoExecutorEncoder
fn clone(&self) -> TychoExecutorEncoder
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 TychoEncoder for TychoExecutorEncoder
impl TychoEncoder for TychoExecutorEncoder
Source§fn validate_solution(&self, solution: &Solution) -> Result<(), EncodingError>
fn validate_solution(&self, solution: &Solution) -> Result<(), EncodingError>
Raises an EncodingError if the solution is not considered valid.
A solution is considered valid if all the following conditions are met:
- The solution is not exact out.
Source§fn encode_solutions(
&self,
solutions: Vec<Solution>,
) -> Result<Vec<EncodedSolution>, EncodingError>
fn encode_solutions( &self, solutions: Vec<Solution>, ) -> Result<Vec<EncodedSolution>, EncodingError>
Encodes a list of
Solutions into EncodedSolutions, which include the function
signature and internal swap call data. Read moreSource§fn encode_full_calldata(
&self,
_solutions: Vec<Solution>,
) -> Result<Vec<Transaction>, EncodingError>
fn encode_full_calldata( &self, _solutions: Vec<Solution>, ) -> Result<Vec<Transaction>, EncodingError>
👎Deprecated: Please use
encode_solutions insteadAuto Trait Implementations§
impl Freeze for TychoExecutorEncoder
impl !RefUnwindSafe for TychoExecutorEncoder
impl Send for TychoExecutorEncoder
impl Sync for TychoExecutorEncoder
impl Unpin for TychoExecutorEncoder
impl !UnwindSafe for TychoExecutorEncoder
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