Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Immutable connection configuration. Debug intentionally omits bearer/test secrets.

Implementations§

Source§

impl Client

Source

pub fn new(base: impl AsRef<str>) -> Result<Self>

Accepts an origin or an /api/v1 base. HTTP is limited to loopback hosts.

Source

pub fn with_auth( self, token: impl Into<String>, organization: impl Into<String>, ) -> Self

Source

pub fn with_test_key(self, key: impl Into<String>) -> Result<Self>

Mandatory IAM sandbox selection remains the backend’s responsibility.

Source

pub fn without_test(self) -> Self

Source

pub fn with_testing_generation(self, generation: i64) -> Result<Self>

Binds requests to a previously observed sandbox generation. A cleaned or rotated environment rejects stale requests rather than applying them anew.

Source

pub fn with_websocket_limit(self, max_bytes: usize) -> Result<Self>

Sets a bounded encoded WebSocket message/frame limit, up to 3 GiB. The default 128 MiB accommodates DM’s default API body ceiling.

Source

pub async fn login(&self, slt: &str, key: &str) -> Result<Tokens>

Source

pub async fn refresh(&self, refresh_token: &str, key: &str) -> Result<Tokens>

Source

pub async fn logout(&self, token: &str, key: &str) -> Result<()>

Source

pub async fn iam(&self) -> Result<IamInfo>

Public IAM application information; does not require login.

Source

pub async fn me(&self) -> Result<Identity>

Source

pub async fn conversations( &self, page: &PageRequest, ) -> Result<Page<Conversation>>

Source

pub async fn create_conversation( &self, participants: &[String], key: &str, ) -> Result<Conversation>

Source

pub async fn messages( &self, conversation: Uuid, page: &PageRequest, include_bundled: bool, ) -> Result<Page<Message>>

Source

pub async fn send_message( &self, conversation: Uuid, message: &MessageCreate, key: &str, ) -> Result<Message>

Source

pub async fn message( &self, conversation: Uuid, message: Uuid, ) -> Result<Message>

Source

pub async fn edit_message( &self, conversation: Uuid, message: Uuid, content: &MessageCreate, version: i64, key: &str, ) -> Result<Message>

Source

pub async fn delete_message( &self, conversation: Uuid, message: Uuid, version: i64, key: &str, ) -> Result<Message>

Source

pub async fn record_receipt( &self, conversation: Uuid, message: Uuid, status: ReceiptStatus, device: &str, ) -> Result<Message>

Source

pub async fn draft(&self, conversation: Uuid) -> Result<Draft>

Source

pub async fn put_draft( &self, conversation: Uuid, draft: &DraftInput, version: i64, ) -> Result<Draft>

Source

pub async fn delete_draft(&self, conversation: Uuid) -> Result<()>

Source

pub async fn create_bundle( &self, conversation: Uuid, bundle: &BundleCreate, key: &str, ) -> Result<Bundle>

Source

pub async fn bundle(&self, conversation: Uuid, bundle: Uuid) -> Result<Bundle>

Source

pub async fn presence(&self, actor: &str) -> Result<Presence>

Source

pub async fn gifs(&self, kind: GifList<'_>) -> Result<Page<Gif>>

Source

pub async fn create_test_environment( &self, input: &TestEnvironmentCreate, key: &str, ) -> Result<TestEnvironment>

Source

pub async fn test_environments( &self, include_deleted: bool, ) -> Result<Page<TestEnvironment>>

Source

pub async fn test_environment(&self, id: Uuid) -> Result<TestEnvironment>

Source

pub async fn update_test_environment( &self, id: Uuid, input: &TestEnvironmentUpdate, key: &str, ) -> Result<TestEnvironment>

Source

pub async fn test_environment_key(&self, id: Uuid) -> Result<TestEnvironmentKey>

Source

pub async fn rotate_test_environment_key( &self, id: Uuid, key: &str, ) -> Result<TestEnvironmentKey>

Source

pub async fn restore_test_environment( &self, id: Uuid, key: &str, ) -> Result<TestEnvironment>

Source

pub async fn clean_test_environment(&self, id: Uuid, key: &str) -> Result<()>

Source

pub async fn delete_test_environment(&self, id: Uuid, key: &str) -> Result<()>

Source

pub async fn connect( &self, actors: &[String], device_id: &str, ) -> Result<Socket>

Connects without reading/writing a cursor or automatically acknowledging messages.

Source

pub async fn connect_with_generation( &self, actors: &[String], device_id: &str, testing_generation: Option<i64>, ) -> Result<Socket>

Supply the last observed sandbox generation; changed generations reset local cursors.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more