pub struct Client { /* private fields */ }Expand description
NATS backend client for messaging, key-value, and blobstore.
Trait Implementations§
Source§impl Backend for Client
impl Backend for Client
Source§type ConnectOptions = ConnectOptions
type ConnectOptions = ConnectOptions
The options used to connect to the backend.
Source§async fn connect_with(options: Self::ConnectOptions) -> Result<Self>
async fn connect_with(options: Self::ConnectOptions) -> Result<Self>
Connect to the resource with the specified options.
Source§impl Client for Client
impl Client for Client
Source§fn subscribe(&self) -> FutureResult<Subscriptions>
fn subscribe(&self) -> FutureResult<Subscriptions>
Subscribe to messages.
Source§fn send(&self, topic: String, message: MessageProxy) -> FutureResult<()>
fn send(&self, topic: String, message: MessageProxy) -> FutureResult<()>
Send a message to a topic.
Source§fn request(
&self,
topic: String,
message: MessageProxy,
options: Option<RequestOptions>,
) -> FutureResult<MessageProxy>
fn request( &self, topic: String, message: MessageProxy, options: Option<RequestOptions>, ) -> FutureResult<MessageProxy>
Request a response from a topic.
Source§impl WasiBlobstoreCtx for Client
wasi-blobstore implementation backed by NATS JetStream object store.
impl WasiBlobstoreCtx for Client
wasi-blobstore implementation backed by NATS JetStream object store.
Source§fn create_container(&self, name: String) -> FutureResult<Arc<dyn Container>>
fn create_container(&self, name: String) -> FutureResult<Arc<dyn Container>>
Open a container.
Source§fn get_container(&self, name: String) -> FutureResult<Arc<dyn Container>>
fn get_container(&self, name: String) -> FutureResult<Arc<dyn Container>>
Get a container.
Source§fn delete_container(&self, name: String) -> FutureResult<()>
fn delete_container(&self, name: String) -> FutureResult<()>
Delete a container.
Source§fn container_exists(&self, name: String) -> FutureResult<bool>
fn container_exists(&self, name: String) -> FutureResult<bool>
Check if a container exists.
Source§impl WasiKeyValueCtx for Client
wasi-keyvalue implementation backed by NATS JetStream KV store.
impl WasiKeyValueCtx for Client
wasi-keyvalue implementation backed by NATS JetStream KV store.
Source§fn open_bucket(&self, identifier: String) -> FutureResult<Arc<dyn Bucket>>
fn open_bucket(&self, identifier: String) -> FutureResult<Arc<dyn Bucket>>
Open a bucket.
Source§impl WasiMessagingCtx for Client
wasi-messaging implementation backed by NATS.
impl WasiMessagingCtx for Client
wasi-messaging implementation backed by NATS.
Source§fn connect(&self) -> FutureResult<Arc<dyn Client>>
fn connect(&self) -> FutureResult<Arc<dyn Client>>
Connect to the messaging system and return a client proxy. Read more
Source§fn new_message(&self, data: Vec<u8>) -> Result<Arc<dyn Message>>
fn new_message(&self, data: Vec<u8>) -> Result<Arc<dyn Message>>
Create a new message with the given payload. Read more
Source§fn set_content_type(
&self,
message: Arc<dyn Message>,
content_type: String,
) -> Result<Arc<dyn Message>>
fn set_content_type( &self, message: Arc<dyn Message>, content_type: String, ) -> Result<Arc<dyn Message>>
Set the content-type on a message. Read more
Source§fn set_payload(
&self,
message: Arc<dyn Message>,
data: Vec<u8>,
) -> Result<Arc<dyn Message>>
fn set_payload( &self, message: Arc<dyn Message>, data: Vec<u8>, ) -> Result<Arc<dyn Message>>
Set the payload on a message. Read more
Source§fn add_metadata(
&self,
message: Arc<dyn Message>,
key: String,
value: String,
) -> Result<Arc<dyn Message>>
fn add_metadata( &self, message: Arc<dyn Message>, key: String, value: String, ) -> Result<Arc<dyn Message>>
Append a key-value pair to the metadata of a message. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request