Struct xapi::Stream

source ·
pub struct Stream { /* private fields */ }

Implementations§

source§

impl Stream

source

pub async fn connect( url: &str, stream_session_id: String ) -> Result<Stream, Error>

source

pub async fn skip_delay(&self)

source

pub async fn get_balance(&self) -> Result<(), Error>

Examples found in repository?
examples/listen-balance.rs (line 10)
7
8
9
10
11
12
13
14
15
16
async fn listen_balance(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_balance().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
source

pub async fn stop_balance(&self) -> Result<(), Error>

source

pub async fn get_candles(&self, symbol: &str) -> Result<(), Error>

Examples found in repository?
examples/listen-candles.rs (line 10)
7
8
9
10
11
12
13
14
15
16
17
async fn listen_candles(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_candles("BITCOIN").await?;
    x.stream.get_candles("ETHEREUM").await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
source

pub async fn stop_candles(&self, symbol: &str) -> Result<(), Error>

source

pub async fn get_keep_alive(&self) -> Result<(), Error>

Examples found in repository?
examples/listen-keep-alive.rs (line 10)
7
8
9
10
11
12
13
14
15
16
async fn listen_keep_alive(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_keep_alive().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
source

pub async fn stop_keep_alive(&self) -> Result<(), Error>

source

pub async fn get_news(&self) -> Result<(), Error>

source

pub async fn stop_news(&self) -> Result<(), Error>

source

pub async fn get_profits(&self) -> Result<(), Error>

Examples found in repository?
examples/listen-profits.rs (line 10)
7
8
9
10
11
12
13
14
15
16
async fn listen_profits(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_profits().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
source

pub async fn stop_profits(&self) -> Result<(), Error>

source

pub async fn get_tick_prices( &self, symbol: &str, min_arrival_time: isize, max_level: isize ) -> Result<(), Error>

Examples found in repository?
examples/listen-tick-prices.rs (line 10)
7
8
9
10
11
12
13
14
15
16
17
async fn listen_tick_prices(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_tick_prices("BITCOIN", 0, 0).await?;
    x.stream.get_tick_prices("ETHEREUM", 0, 0).await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
source

pub async fn stop_tick_prices(&self, symbol: &str) -> Result<(), Error>

source

pub async fn get_trades(&self) -> Result<(), Error>

source

pub async fn stop_trades(&self) -> Result<(), Error>

source

pub async fn get_trade_status(&self) -> Result<(), Error>

source

pub async fn stop_trade_status(&self) -> Result<(), Error>

source

pub async fn ping(&self) -> Result<(), Error>

source

pub async fn listen(&self) -> Result<Record, Error>

Examples found in repository?
examples/listen-balance.rs (line 13)
7
8
9
10
11
12
13
14
15
16
async fn listen_balance(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_balance().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
More examples
Hide additional examples
examples/listen-profits.rs (line 13)
7
8
9
10
11
12
13
14
15
16
async fn listen_profits(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_profits().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
examples/listen-keep-alive.rs (line 13)
7
8
9
10
11
12
13
14
15
16
async fn listen_keep_alive(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_keep_alive().await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
examples/listen-candles.rs (line 14)
7
8
9
10
11
12
13
14
15
16
17
async fn listen_candles(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_candles("BITCOIN").await?;
    x.stream.get_candles("ETHEREUM").await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}
examples/listen-tick-prices.rs (line 14)
7
8
9
10
11
12
13
14
15
16
17
async fn listen_tick_prices(credentials: &xapi::Credentials) -> Result<(), xapi::Error> {
    let x = xapi::connect(&credentials).await?;

    x.stream.get_tick_prices("BITCOIN", 0, 0).await?;
    x.stream.get_tick_prices("ETHEREUM", 0, 0).await?;

    loop {
        let record = x.stream.listen().await?;
        println!("{:?}", record);
    }
}

Trait Implementations§

source§

impl Clone for Stream

source§

fn clone(&self) -> Stream

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Stream

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Stream

§

impl Send for Stream

§

impl Sync for Stream

§

impl Unpin for Stream

§

impl !UnwindSafe for Stream

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V