pub struct SocketInitiator<'a, A, L, S>{ /* private fields */ }
Expand description
Socket implementation of establishing connections handler.
Implementations§
Source§impl<'a, A, L, S> SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> SocketInitiator<'a, A, L, S>
Sourcepub fn try_new(
settings: &SessionSettings,
application: &'a Application<'_, A>,
store_factory: &'a S,
log_factory: &'a LogFactory<'_, L>,
) -> Result<Self, QuickFixError>
pub fn try_new( settings: &SessionSettings, application: &'a Application<'_, A>, store_factory: &'a S, log_factory: &'a LogFactory<'_, L>, ) -> Result<Self, QuickFixError>
Try create new struct from its mandatory components.
Examples found in repository?
examples/fix_repl/main.rs (lines 32-37)
14fn main() -> Result<(), QuickFixError> {
15 let args: Vec<_> = env::args().collect();
16 let (Some(connect_mode), Some(config_file)) = (args.get(1), args.get(2)) else {
17 eprintln!(
18 "Bad program usage: {} [acceptor|initiator] <config_file>",
19 args[0]
20 );
21 exit(1);
22 };
23
24 println!(">> Creating resources");
25 let settings = SessionSettings::try_from_path(config_file)?;
26 let store_factory = FileMessageStoreFactory::try_new(&settings)?;
27 let log_factory = LogFactory::try_new(&StdLogger::Stdout)?;
28 let callbacks = MyApplication::new();
29 let app = Application::try_new(&callbacks)?;
30
31 match connect_mode.as_str() {
32 "initiator" => server_loop(SocketInitiator::try_new(
33 &settings,
34 &app,
35 &store_factory,
36 &log_factory,
37 )?),
38 "acceptor" => server_loop(SocketAcceptor::try_new(
39 &settings,
40 &app,
41 &store_factory,
42 &log_factory,
43 )?),
44 _ => {
45 eprintln!("Invalid connection mode");
46 exit(1);
47 }
48 }?;
49
50 println!(">> All cleared. Bye !");
51 Ok(())
52}
Trait Implementations§
Source§impl<A, L, S> ConnectionHandler for SocketInitiator<'_, A, L, S>
impl<A, L, S> ConnectionHandler for SocketInitiator<'_, A, L, S>
Source§fn is_logged_on(&self) -> Result<bool, QuickFixError>
fn is_logged_on(&self) -> Result<bool, QuickFixError>
Check if handler has sent logging message or not.
Source§fn is_stopped(&self) -> Result<bool, QuickFixError>
fn is_stopped(&self) -> Result<bool, QuickFixError>
Check if handler is currently working or not.
Source§impl<'a, A, L, S> Debug for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> Debug for SocketInitiator<'a, A, L, S>
Source§impl<A, L, S> Drop for SocketInitiator<'_, A, L, S>
impl<A, L, S> Drop for SocketInitiator<'_, A, L, S>
Source§impl<A, L, S> SessionContainer for SocketInitiator<'_, A, L, S>
impl<A, L, S> SessionContainer for SocketInitiator<'_, A, L, S>
Auto Trait Implementations§
impl<'a, A, L, S> Freeze for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> RefUnwindSafe for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> !Send for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> !Sync for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> Unpin for SocketInitiator<'a, A, L, S>
impl<'a, A, L, S> UnwindSafe for SocketInitiator<'a, A, L, S>
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