LogonEvent

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>

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 message
  • None - Should never happen (logon events always have a message)

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 modify
  • None - For initiators or if not available

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 modify
  • None - For initiators or if not available

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)

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 response
    • logon_action::DISCONNECT_WITH_LOGOUT - Reject and send Logout message
    • logon_action::DISCONNECT - Reject without sending a message

Auto Trait Implementations§

§

impl<'a> Freeze for LogonEvent<'a>

§

impl<'a> RefUnwindSafe for LogonEvent<'a>

§

impl<'a> Send for LogonEvent<'a>

§

impl<'a> Sync for LogonEvent<'a>

§

impl<'a> Unpin for LogonEvent<'a>

§

impl<'a> UnwindSafe for LogonEvent<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.