pub struct Client { /* private fields */ }Expand description
Immutable connection configuration. Debug intentionally omits bearer/test secrets.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(base: impl AsRef<str>) -> Result<Self>
pub fn new(base: impl AsRef<str>) -> Result<Self>
Accepts an origin or an /api/v1 base. HTTP is limited to loopback hosts.
pub fn with_auth( self, token: impl Into<String>, organization: impl Into<String>, ) -> Self
Sourcepub fn with_test_key(self, key: impl Into<String>) -> Result<Self>
pub fn with_test_key(self, key: impl Into<String>) -> Result<Self>
Mandatory IAM sandbox selection remains the backend’s responsibility.
pub fn without_test(self) -> Self
Sourcepub fn with_testing_generation(self, generation: i64) -> Result<Self>
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.
Sourcepub fn with_websocket_limit(self, max_bytes: usize) -> Result<Self>
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.
pub async fn login(&self, slt: &str, key: &str) -> Result<Tokens>
pub async fn refresh(&self, refresh_token: &str, key: &str) -> Result<Tokens>
pub async fn logout(&self, token: &str, key: &str) -> Result<()>
Sourcepub async fn iam(&self) -> Result<IamInfo>
pub async fn iam(&self) -> Result<IamInfo>
Public IAM application information; does not require login.
pub async fn me(&self) -> Result<Identity>
pub async fn conversations( &self, page: &PageRequest, ) -> Result<Page<Conversation>>
pub async fn create_conversation( &self, participants: &[String], key: &str, ) -> Result<Conversation>
pub async fn messages( &self, conversation: Uuid, page: &PageRequest, include_bundled: bool, ) -> Result<Page<Message>>
pub async fn send_message( &self, conversation: Uuid, message: &MessageCreate, key: &str, ) -> Result<Message>
pub async fn message( &self, conversation: Uuid, message: Uuid, ) -> Result<Message>
pub async fn edit_message( &self, conversation: Uuid, message: Uuid, content: &MessageCreate, version: i64, key: &str, ) -> Result<Message>
pub async fn delete_message( &self, conversation: Uuid, message: Uuid, version: i64, key: &str, ) -> Result<Message>
pub async fn record_receipt( &self, conversation: Uuid, message: Uuid, status: ReceiptStatus, device: &str, ) -> Result<Message>
pub async fn draft(&self, conversation: Uuid) -> Result<Draft>
pub async fn put_draft( &self, conversation: Uuid, draft: &DraftInput, version: i64, ) -> Result<Draft>
pub async fn delete_draft(&self, conversation: Uuid) -> Result<()>
pub async fn create_bundle( &self, conversation: Uuid, bundle: &BundleCreate, key: &str, ) -> Result<Bundle>
pub async fn bundle(&self, conversation: Uuid, bundle: Uuid) -> Result<Bundle>
pub async fn presence(&self, actor: &str) -> Result<Presence>
pub async fn gifs(&self, kind: GifList<'_>) -> Result<Page<Gif>>
pub async fn create_test_environment( &self, input: &TestEnvironmentCreate, key: &str, ) -> Result<TestEnvironment>
pub async fn test_environments( &self, include_deleted: bool, ) -> Result<Page<TestEnvironment>>
pub async fn test_environment(&self, id: Uuid) -> Result<TestEnvironment>
pub async fn update_test_environment( &self, id: Uuid, input: &TestEnvironmentUpdate, key: &str, ) -> Result<TestEnvironment>
pub async fn test_environment_key(&self, id: Uuid) -> Result<TestEnvironmentKey>
pub async fn rotate_test_environment_key( &self, id: Uuid, key: &str, ) -> Result<TestEnvironmentKey>
pub async fn restore_test_environment( &self, id: Uuid, key: &str, ) -> Result<TestEnvironment>
pub async fn clean_test_environment(&self, id: Uuid, key: &str) -> Result<()>
pub async fn delete_test_environment(&self, id: Uuid, key: &str) -> Result<()>
Trait Implementations§
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