Struct async_nats::Client
source · [−]pub struct Client { /* private fields */ }
Implementations
sourceimpl Client
impl Client
pub async fn publish(
&mut self,
subject: String,
payload: Bytes
) -> Result<(), Error>
pub async fn publish_with_reply(
&mut self,
subject: String,
reply: String,
payload: Bytes
) -> Result<(), Error>
pub async fn request(
&mut self,
subject: String,
payload: Bytes
) -> Result<Message, Error>
sourcepub fn new_inbox(&self) -> String
pub fn new_inbox(&self) -> String
Create a new globally unique inbox which can be used for replies.
Examples
let reply = nc.new_inbox();
let rsub = nc.subscribe(reply).await?;
pub async fn subscribe(&mut self, subject: String) -> Result<Subscriber, Error>
pub async fn flush(&mut self) -> Result<(), Error>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more