[][src]Struct ratsio::nats_client::NatsClient

pub struct NatsClient { /* fields omitted */ }

Implementations

impl NatsClient[src]

pub async fn new<O>(options: O) -> Result<Arc<Self>, RatsioError> where
    O: Into<NatsClientOptions>, 
[src]

pub async fn subscribe<T, '_>(
    &'_ self,
    subject: T
) -> Result<(NatsSid, impl Stream<Item = Message> + Send + Sync), RatsioError> where
    T: ToString
[src]

pub async fn subscribe_with_group<T, '_>(
    &'_ self,
    subject: T,
    group: T
) -> Result<(NatsSid, impl Stream<Item = Message> + Send + Sync), RatsioError> where
    T: ToString
[src]

pub async fn un_subscribe<'_, '_>(
    &'_ self,
    sid: &'_ NatsSid
) -> Result<(), RatsioError>
[src]

pub async fn publish<T, '_, '_>(
    &'_ self,
    subject: T,
    data: &'_ [u8]
) -> Result<(), RatsioError> where
    T: ToString
[src]

pub async fn publish_with_reply_to<T, '_, '_>(
    &'_ self,
    subject: T,
    reply_to: T,
    data: &'_ [u8]
) -> Result<(), RatsioError> where
    T: ToString
[src]

pub async fn request<T, '_, '_>(
    &'_ self,
    subject: T,
    data: &'_ [u8]
) -> Result<Message, RatsioError> where
    T: ToString
[src]

pub async fn close<'_>(&'_ self) -> Result<(), RatsioError>[src]

pub fn add_reconnect_handler(
    &self,
    handler: Box<dyn Fn(&NatsClient) + Send + Sync>
) -> Result<(), RatsioError>
[src]

Trait Implementations

impl Debug for NatsClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.