pub struct Bot { /* private fields */ }Expand description
The Bot manages the execution of a strategy.
Implementations§
Source§impl Bot
impl Bot
pub fn new(client: PocketOption, strategy: Box<dyn Strategy>) -> Self
pub fn with_update_interval(&mut self, duration: Duration)
Sourcepub fn with_market(self, market: Arc<dyn Market>) -> Self
pub fn with_market(self, market: Arc<dyn Market>) -> Self
Sets a custom market implementation (e.g., VirtualMarket for backtesting).
Sourcepub fn add_asset(
&mut self,
asset: impl Into<String>,
sub_type: SubscriptionType,
)
pub fn add_asset( &mut self, asset: impl Into<String>, sub_type: SubscriptionType, )
Adds an asset to monitor with a specific subscription type.
Sourcepub async fn run(&mut self) -> PocketResult<()>
pub async fn run(&mut self) -> PocketResult<()>
Starts the bot and its strategy loop.
Auto Trait Implementations§
impl Freeze for Bot
impl !RefUnwindSafe for Bot
impl Send for Bot
impl Sync for Bot
impl Unpin for Bot
impl UnsafeUnpin for Bot
impl !UnwindSafe for Bot
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