Struct fugle::listener::Intraday [−][src]
pub struct Intraday { /* fields omitted */ }
Expand description
Intraday is the Websocket listener to fugle wws endpoints.
Implementations
Returns an Intraday instance.
When listening on each endpoint, Intraday will fork a thread to do the listening job, so need to use mpsc::channel receiver to receive response data.
And as a daemon like process, it won’t break while any error ocurs, instead it will log the error.
Please reference to below link to know how to print the log out. https://github.com/rust-lang/log
Example:
let (tx, rx) = mpsc::channel(); let mut lis = listener::Intraday::new("demo", tx.clone());
Listening fugle Chart endpoint.
Example:
let (tx, rx) = mpsc::channel(); let mut lis = listener::Intraday::new("demo", tx.clone()); lis.chart("2884", true); let response = rx.recv()?;
Listening fugle Meta endpoint.
Example:
let (tx, rx) = mpsc::channel(); let mut lis = listener::Intraday::new("demo", tx.clone()); lis.meta("2884", true); let response = rx.recv()?;
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Intraday
impl !UnwindSafe for Intraday