pub use crate::core::types::instrument::InstrumentMeta;
use crate::{core::Symbol, Request};
use either::Either;
use exc_core::Str;
use rust_decimal::Decimal;
#[derive(Debug, Clone)]
pub struct GetInstrument {
pub symbol: Either<Symbol, Str>,
}
impl Request for GetInstrument {
type Response = Option<InstrumentMeta<Decimal>>;
}
impl GetInstrument {
pub fn with_symbol(symbol: &Symbol) -> Self {
Self {
symbol: Either::Left(symbol.clone()),
}
}
pub fn with_name(name: &str) -> Self {
Self {
symbol: Either::Right(Str::new(name)),
}
}
}