Skip to main content

Application

Trait Application 

Source
pub trait Application: Send + Sync {
    // Required methods
    fn on_create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn on_logon<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn on_logout<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn to_admin<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        message: &'life1 mut OwnedMessage,
        session_id: &'life2 SessionId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn from_admin<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        message: &'life1 RawMessage<'life2>,
        session_id: &'life3 SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<(), RejectReason>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn to_app<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        message: &'life1 mut OwnedMessage,
        session_id: &'life2 SessionId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn from_app<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        message: &'life1 RawMessage<'life2>,
        session_id: &'life3 SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<(), RejectReason>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
}
Expand description

Application callback interface for handling FIX messages.

Implement this trait to receive callbacks for session events and message processing.

Required Methods§

Source

fn on_create<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Called when a session is created.

§Arguments
  • session_id - The session identifier
Source

fn on_logon<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Called on successful logon.

§Arguments
  • session_id - The session identifier
Source

fn on_logout<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Called on logout.

§Arguments
  • session_id - The session identifier
Source

fn to_admin<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, message: &'life1 mut OwnedMessage, session_id: &'life2 SessionId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Called before sending an admin message.

Allows modification of outgoing admin messages (Logon, Heartbeat, etc.).

§Arguments
  • message - The message to be sent (mutable)
  • session_id - The session identifier
Source

fn from_admin<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, message: &'life1 RawMessage<'life2>, session_id: &'life3 SessionId, ) -> Pin<Box<dyn Future<Output = Result<(), RejectReason>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Called when an admin message is received.

§Arguments
  • message - The received message
  • session_id - The session identifier
§Returns

Ok(()) to accept, Err(RejectReason) to reject.

Source

fn to_app<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, message: &'life1 mut OwnedMessage, session_id: &'life2 SessionId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Called before sending an application message.

Allows modification of outgoing application messages.

§Arguments
  • message - The message to be sent (mutable)
  • session_id - The session identifier
Source

fn from_app<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, message: &'life1 RawMessage<'life2>, session_id: &'life3 SessionId, ) -> Pin<Box<dyn Future<Output = Result<(), RejectReason>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Called when an application message is received.

§Arguments
  • message - The received message
  • session_id - The session identifier
§Returns

Ok(()) to accept, Err(RejectReason) to reject.

Implementors§