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()?;

Listening fugle Quote endpoint.

Example:


let (tx, rx) = mpsc::channel();
let mut lis = listener::Intraday::new("demo", tx.clone());

lis.quote("2884", true);
let response = rx.recv()?;

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.