pub struct TrellisClient { /* private fields */ }Expand description
A low-level Trellis client over NATS request/reply and publish primitives.
Implementations§
Source§impl TrellisClient
impl TrellisClient
Sourcepub fn auth(&self) -> &SessionAuth
pub fn auth(&self) -> &SessionAuth
Return the session auth helper used by this client.
Sourcepub async fn connect_service(
opts: ServiceConnectOptions<'_>,
) -> Result<Self, TrellisClientError>
pub async fn connect_service( opts: ServiceConnectOptions<'_>, ) -> Result<Self, TrellisClientError>
Connect using sentinel credentials plus an iat-based service token.
Sourcepub async fn connect_user(
opts: UserConnectOptions<'_>,
) -> Result<Self, TrellisClientError>
pub async fn connect_user( opts: UserConnectOptions<'_>, ) -> Result<Self, TrellisClientError>
Connect using a previously issued binding token.
Sourcepub async fn request_json_value(
&self,
subject: &str,
body: &Value,
) -> Result<Value, TrellisClientError>
pub async fn request_json_value( &self, subject: &str, body: &Value, ) -> Result<Value, TrellisClientError>
Call a raw subject with a JSON value payload.
Sourcepub async fn call<D>(
&self,
input: &D::Input,
) -> Result<D::Output, TrellisClientError>where
D: RpcDescriptor,
pub async fn call<D>(
&self,
input: &D::Input,
) -> Result<D::Output, TrellisClientError>where
D: RpcDescriptor,
Call one descriptor-backed RPC.
Sourcepub async fn publish<D>(
&self,
event: &D::Event,
) -> Result<(), TrellisClientError>where
D: EventDescriptor,
pub async fn publish<D>(
&self,
event: &D::Event,
) -> Result<(), TrellisClientError>where
D: EventDescriptor,
Publish one descriptor-backed event.
Auto Trait Implementations§
impl Freeze for TrellisClient
impl !RefUnwindSafe for TrellisClient
impl Send for TrellisClient
impl Sync for TrellisClient
impl Unpin for TrellisClient
impl UnsafeUnpin for TrellisClient
impl !UnwindSafe for TrellisClient
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