Э
#[cfg(any(features))] не работает[features]
any = ["a", "b"]
в Cargo.toml
Size: a a a
Э
#[cfg(any(features))] не работает[features]
any = ["a", "b"]
Э
full, а не any.АК
Э
АК
Э
АК
АК
VB
АК
VB
VB
АК
error[E0271]: type mismatch resolving `<S as match_engine::strategies::MatchStrategy>::OrderBook == order_book::FastOrderBook`
--> src\order_book\mod.rs:269:5
|
269 | / fn get_possible_matches<S, T>(&self, terms: T) -> Result<S::Matches, S::MatchErr>
270 | | where S: MatchStrategy<OrderBook=FastOrderBook>,
271 | | T: Into<S::MatchTerms>,
272 | | {
273 | | S::match_strategy(self, terms.into())
274 | | }
| |_____^ expected associated type, found struct `order_book::FastOrderBook`
|
= note: expected associated type `<S as match_engine::strategies::MatchStrategy>::OrderBook`
found struct `order_book::FastOrderBook`
= note: the requirement `<S as match_engine::strategies::MatchStrategy>::OrderBook == order_book::FastOrderBook` appears on the impl method but not on the corresponding trait method
АК
АК
V
АК
impl OrderBookTrait for FastOrderBook {
fn get_possible_matches<S, T>(&self, terms: T) -> Result<S::Matches, S::MatchErr>
where S: MatchStrategy<OrderBook=Self>,
T: Into<S::MatchTerms>,
{
S::match_strategy(self, terms.into())
}
}V
АК
pub trait MatchStrategy {
type OrderBook;
type MatchTerms;
type Matches;
type MatchErr;
fn match_strategy(
order_book: &Self::OrderBook, terms: Self::MatchTerms,
) -> Result<Self::Matches, Self::MatchErr>;
}АК