Struct LogonEvent
pub struct LogonEvent<'a> { /* private fields */ }Expand description
Logon event - received when a Logon message arrives from the counterparty
This event is only valid within the callback scope. It contains:
- Incoming logon message (read-only)
- Outgoing logon/logout messages (for acceptor only, mutable)
- Logon action (mutable) - determines how to respond
§Lifetime
The lifetime 'a ensures this event cannot outlive the callback scope.
All message references are zero-copy borrows from C++.
Implementations§
§impl<'a> LogonEvent<'a>
impl<'a> LogonEvent<'a>
pub fn incoming_logon_message(&self) -> Option<&'a FixMessage>
pub fn incoming_logon_message(&self) -> Option<&'a FixMessage>
Get the incoming logon message (read-only)
This is the Logon message received from the counterparty.
§Returns
Some(&FixMessage)- The incoming logon messageNone- Should never happen (logon events always have a message)
pub fn outgoing_logon_message(&mut self) -> Option<&'a mut FixMessage>
pub fn outgoing_logon_message(&mut self) -> Option<&'a mut FixMessage>
Get the outgoing logon message (for acceptor only)
This message is used when logon_action() is set to AcceptWithConfirmLogon.
The acceptor can modify this message before it’s sent.
§Returns
Some(&mut FixMessage)- Mutable reference for acceptor to modifyNone- For initiators or if not available
pub fn outgoing_logout_message(&mut self) -> Option<&'a mut FixMessage>
pub fn outgoing_logout_message(&mut self) -> Option<&'a mut FixMessage>
Get the outgoing logout message (for acceptor only)
This message is used when logon_action() is set to DisconnectWithLogout.
The acceptor can modify this message before it’s sent.
§Returns
Some(&mut FixMessage)- Mutable reference for acceptor to modifyNone- For initiators or if not available
pub fn logon_action(&self) -> LogonAction
pub fn logon_action(&self) -> LogonAction
Get the current logon action
Defaults to logon_action::ACCEPT_WITH_CONFIRM_LOGON.
§Returns
One of the logon_action::* constants
pub fn set_logon_action(&mut self, action: LogonAction)
pub fn set_logon_action(&mut self, action: LogonAction)
Set the logon action to control the response
§Arguments
action- How to respond to the logon:logon_action::ACCEPT_WITH_CONFIRM_LOGON- Accept and send Logon responselogon_action::DISCONNECT_WITH_LOGOUT- Reject and send Logout messagelogon_action::DISCONNECT- Reject without sending a message