docs: (WIP) In-code docs for encoders

- TODO double check all this, look for missing docs
This commit is contained in:
TAMARA LIPOWSKI
2025-02-04 18:11:32 -05:00
parent 25a26f21be
commit 52cce5f5c6
10 changed files with 72 additions and 6 deletions

View File

@@ -13,6 +13,9 @@ pub trait StrategyEncoder {
fn get_swap_encoder(&self, protocol_system: &str) -> Option<&Box<dyn SwapEncoder>>;
}
/// Contains the supported strategies to encode a solution, and chooses the best strategy to encode
/// a solution based on the solution's attributes.
pub trait StrategyEncoderRegistry {
fn new(
chain: Chain,
@@ -21,6 +24,8 @@ pub trait StrategyEncoderRegistry {
) -> Result<Self, EncodingError>
where
Self: Sized;
/// Returns the strategy encoder that should be used to encode the given solution.
#[allow(clippy::borrowed_box)]
fn get_encoder(&self, solution: &Solution) -> Result<&Box<dyn StrategyEncoder>, EncodingError>;
}