pub struct Session { /* private fields */ }Expand description
FIX session manager
Implementations§
Source§impl Session
impl Session
Sourcepub fn set_connection(&mut self, connection: Arc<Mutex<Connection>>)
pub fn set_connection(&mut self, connection: Arc<Mutex<Connection>>)
Set the connection for this session
Sourcepub async fn send_heartbeat(
&mut self,
test_req_id: Option<String>,
) -> Result<()>
pub async fn send_heartbeat( &mut self, test_req_id: Option<String>, ) -> Result<()>
Send a heartbeat message
Sourcepub async fn send_new_order(&mut self, order: NewOrderRequest) -> Result<String>
pub async fn send_new_order(&mut self, order: NewOrderRequest) -> Result<String>
Send a new order
Sourcepub async fn cancel_order(&mut self, order_id: String) -> Result<()>
pub async fn cancel_order(&mut self, order_id: String) -> Result<()>
Cancel an order
Sourcepub async fn subscribe_market_data(&mut self, symbol: String) -> Result<()>
pub async fn subscribe_market_data(&mut self, symbol: String) -> Result<()>
Subscribe to market data
Sourcepub async fn request_positions(&mut self) -> Result<Vec<Position>>
pub async fn request_positions(&mut self) -> Result<Vec<Position>>
Request positions
Sourcepub fn state(&self) -> SessionState
pub fn state(&self) -> SessionState
Get current session state
Sourcepub fn set_state(&mut self, state: SessionState)
pub fn set_state(&mut self, state: SessionState)
Set session state (for testing)
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
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