Struct kraken_ws_client::client::PublicClient
source · pub struct PublicClient { /* private fields */ }
Implementations§
source§impl PublicClient
impl PublicClient
sourcepub fn book_delta_events(&mut self) -> impl Stream<Item = BookEvent>
pub fn book_delta_events(&mut self) -> impl Stream<Item = BookEvent>
Examples found in repository?
examples/book.rs (line 15)
5 6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let mut client = kraken_ws_client::connect_public()
.await
.expect("cannot connect");
client
.send(SubscribeBookRequest::symbol("BTC/USD").depth(Depth::D10))
.await
.expect("cannot send request");
while let Some(event) = client.book_delta_events().next().await {
dbg!(&event);
}
}
source§impl PublicClient
impl PublicClient
pub fn instrument_events(&mut self) -> impl Stream<Item = InstrumentEvent>
source§impl PublicClient
impl PublicClient
sourcepub fn ticker_events(&mut self) -> impl Stream<Item = TickerEvent>
pub fn ticker_events(&mut self) -> impl Stream<Item = TickerEvent>
Examples found in repository?
examples/ticker.rs (line 15)
5 6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let mut client = kraken_ws_client::connect_public()
.await
.expect("cannot connect");
client
.send(SubscribeTickerRequest::symbol("BTC/USD"))
.await
.expect("cannot send request");
while let Some(event) = client.ticker_events().next().await {
dbg!(&event);
}
}
source§impl PublicClient
impl PublicClient
pub fn trade_events(&mut self) -> impl Stream<Item = TradeEvent>
source§impl PublicClient
impl PublicClient
pub fn ohlc_events(&mut self) -> impl Stream<Item = OhlcEvent>
source§impl PublicClient
impl PublicClient
pub async fn connect() -> Result<Self>
sourcepub async fn send<P>(&mut self, req: PublicRequest<P>) -> Result<()>where
P: Serialize,
pub async fn send<P>(&mut self, req: PublicRequest<P>) -> Result<()>where
P: Serialize,
Examples found in repository?
examples/ticker.rs (line 11)
5 6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let mut client = kraken_ws_client::connect_public()
.await
.expect("cannot connect");
client
.send(SubscribeTickerRequest::symbol("BTC/USD"))
.await
.expect("cannot send request");
while let Some(event) = client.ticker_events().next().await {
dbg!(&event);
}
}
More examples
examples/book.rs (line 11)
5 6 7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let mut client = kraken_ws_client::connect_public()
.await
.expect("cannot connect");
client
.send(SubscribeBookRequest::symbol("BTC/USD").depth(Depth::D10))
.await
.expect("cannot send request");
while let Some(event) = client.book_delta_events().next().await {
dbg!(&event);
}
}
pub fn messages(&mut self) -> Receiver<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PublicClient
impl !RefUnwindSafe for PublicClient
impl Send for PublicClient
impl Sync for PublicClient
impl Unpin for PublicClient
impl !UnwindSafe for PublicClient
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