pub trait ClientBackend:
Debug
+ Send
+ Sync
+ 'static {
Show 34 methods
// Required methods
fn auth_start(
&self,
request: AuthStartRequest,
) -> BoxFuture<'static, BackendResult<AuthStartResult>>;
fn auth_verify(
&self,
request: AuthVerifyRequest,
) -> BoxFuture<'static, BackendResult<AuthVerifyResult>>;
fn resume_session(
&self,
) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>;
fn connect(
&self,
request: ConnectRequest,
) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>;
fn logout(&self) -> BoxFuture<'static, BackendResult<()>>;
fn dialogs(
&self,
request: DialogsRequest,
) -> BoxFuture<'static, BackendResult<DialogsPage>>;
fn cached_dialogs(
&self,
request: DialogsRequest,
) -> BoxFuture<'static, BackendResult<DialogsPage>>;
fn account_state(
&self,
) -> BoxFuture<'static, BackendResult<AccountStateSnapshot>>;
fn chat_state(
&self,
chat_id: InlineId,
) -> BoxFuture<'static, BackendResult<ChatStateSnapshot>>;
fn history(
&self,
request: HistoryRequest,
) -> BoxFuture<'static, BackendResult<HistoryPage>>;
fn cached_history(
&self,
request: HistoryRequest,
) -> BoxFuture<'static, BackendResult<HistoryPage>>;
fn chat_participants(
&self,
request: ChatParticipantsRequest,
) -> BoxFuture<'static, BackendResult<ChatParticipantsPage>>;
fn add_chat_participant(
&self,
request: AddChatParticipantRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn remove_chat_participant(
&self,
request: RemoveChatParticipantRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn update_chat_info(
&self,
request: UpdateChatInfoRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn delete_chat(
&self,
request: DeleteChatRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn create_dm(
&self,
request: CreateDmRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>;
fn create_thread(
&self,
request: CreateThreadRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>;
fn create_reply_thread(
&self,
request: CreateReplyThreadRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>;
fn send_text(
&self,
request: SendTextRequest,
) -> BoxFuture<'static, BackendResult<SendTextOutcome>>;
fn send_media(
&self,
request: UploadRequest,
bytes: Vec<u8>,
) -> BoxFuture<'static, BackendResult<SendTextOutcome>>;
fn edit_message(
&self,
request: EditMessageRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn delete_message(
&self,
request: DeleteMessageRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn react(
&self,
request: ReactRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn read(
&self,
request: ReadRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn set_marked_unread(
&self,
request: SetMarkedUnreadRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn update_dialog_notifications(
&self,
request: UpdateDialogNotificationsRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn typing(
&self,
request: TypingRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>;
fn receive_events(
&self,
) -> BoxFuture<'static, BackendResult<Vec<ClientEvent>>>;
// Provided methods
fn receive_event_deliveries(
&self,
) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>> { ... }
fn stage_client_events(
&self,
events: Vec<ClientEvent>,
) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>> { ... }
fn acknowledge_event_delivery(
&self,
_delivery_id: u64,
) -> BoxFuture<'static, BackendResult<()>> { ... }
fn release_event_delivery(&self, _delivery_id: u64) { ... }
fn reset_event_delivery_claims(
&self,
) -> BoxFuture<'static, BackendResult<()>> { ... }
}Expand description
Async backend boundary for the client runner.
Required Methods§
Sourcefn auth_start(
&self,
request: AuthStartRequest,
) -> BoxFuture<'static, BackendResult<AuthStartResult>>
fn auth_start( &self, request: AuthStartRequest, ) -> BoxFuture<'static, BackendResult<AuthStartResult>>
Sends an Inline login code.
Sourcefn auth_verify(
&self,
request: AuthVerifyRequest,
) -> BoxFuture<'static, BackendResult<AuthVerifyResult>>
fn auth_verify( &self, request: AuthVerifyRequest, ) -> BoxFuture<'static, BackendResult<AuthVerifyResult>>
Verifies an Inline login code and persists the resulting session.
Sourcefn resume_session(
&self,
) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>
fn resume_session( &self, ) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>
Resumes a previously stored session, if available.
Sourcefn connect(
&self,
request: ConnectRequest,
) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>
fn connect( &self, request: ConnectRequest, ) -> BoxFuture<'static, BackendResult<ClientStatusSnapshot>>
Connects or reconnects the client.
Sourcefn logout(&self) -> BoxFuture<'static, BackendResult<()>>
fn logout(&self) -> BoxFuture<'static, BackendResult<()>>
Logs out the current account.
Sourcefn dialogs(
&self,
request: DialogsRequest,
) -> BoxFuture<'static, BackendResult<DialogsPage>>
fn dialogs( &self, request: DialogsRequest, ) -> BoxFuture<'static, BackendResult<DialogsPage>>
Lists dialogs.
Sourcefn cached_dialogs(
&self,
request: DialogsRequest,
) -> BoxFuture<'static, BackendResult<DialogsPage>>
fn cached_dialogs( &self, request: DialogsRequest, ) -> BoxFuture<'static, BackendResult<DialogsPage>>
Lists only durable cached dialogs without a network request.
Sourcefn account_state(
&self,
) -> BoxFuture<'static, BackendResult<AccountStateSnapshot>>
fn account_state( &self, ) -> BoxFuture<'static, BackendResult<AccountStateSnapshot>>
Loads account-level durable state used for consumer reconciliation.
Sourcefn chat_state(
&self,
chat_id: InlineId,
) -> BoxFuture<'static, BackendResult<ChatStateSnapshot>>
fn chat_state( &self, chat_id: InlineId, ) -> BoxFuture<'static, BackendResult<ChatStateSnapshot>>
Loads durable state for one chat used for consumer reconciliation.
Sourcefn history(
&self,
request: HistoryRequest,
) -> BoxFuture<'static, BackendResult<HistoryPage>>
fn history( &self, request: HistoryRequest, ) -> BoxFuture<'static, BackendResult<HistoryPage>>
Fetches chat history.
Sourcefn cached_history(
&self,
request: HistoryRequest,
) -> BoxFuture<'static, BackendResult<HistoryPage>>
fn cached_history( &self, request: HistoryRequest, ) -> BoxFuture<'static, BackendResult<HistoryPage>>
Fetches only the client’s durable cached history without making a
network request. This is intended for offline consumers and state
reconciliation; ordinary callers should prefer Self::history.
Sourcefn chat_participants(
&self,
request: ChatParticipantsRequest,
) -> BoxFuture<'static, BackendResult<ChatParticipantsPage>>
fn chat_participants( &self, request: ChatParticipantsRequest, ) -> BoxFuture<'static, BackendResult<ChatParticipantsPage>>
Fetches chat participants.
Sourcefn add_chat_participant(
&self,
request: AddChatParticipantRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn add_chat_participant( &self, request: AddChatParticipantRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Adds a user to a chat.
Sourcefn remove_chat_participant(
&self,
request: RemoveChatParticipantRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn remove_chat_participant( &self, request: RemoveChatParticipantRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Removes a user from a chat.
Sourcefn update_chat_info(
&self,
request: UpdateChatInfoRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn update_chat_info( &self, request: UpdateChatInfoRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Updates mutable chat metadata.
Sourcefn delete_chat(
&self,
request: DeleteChatRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn delete_chat( &self, request: DeleteChatRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Deletes a chat when permitted by the service.
Sourcefn create_dm(
&self,
request: CreateDmRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>
fn create_dm( &self, request: CreateDmRequest, ) -> BoxFuture<'static, BackendResult<CreatedChat>>
Creates or opens a direct message chat.
Sourcefn create_thread(
&self,
request: CreateThreadRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>
fn create_thread( &self, request: CreateThreadRequest, ) -> BoxFuture<'static, BackendResult<CreatedChat>>
Creates a regular Inline thread chat.
Sourcefn create_reply_thread(
&self,
request: CreateReplyThreadRequest,
) -> BoxFuture<'static, BackendResult<CreatedChat>>
fn create_reply_thread( &self, request: CreateReplyThreadRequest, ) -> BoxFuture<'static, BackendResult<CreatedChat>>
Creates a child/reply Inline thread chat.
Sourcefn send_text(
&self,
request: SendTextRequest,
) -> BoxFuture<'static, BackendResult<SendTextOutcome>>
fn send_text( &self, request: SendTextRequest, ) -> BoxFuture<'static, BackendResult<SendTextOutcome>>
Sends a text message.
Sourcefn send_media(
&self,
request: UploadRequest,
bytes: Vec<u8>,
) -> BoxFuture<'static, BackendResult<SendTextOutcome>>
fn send_media( &self, request: UploadRequest, bytes: Vec<u8>, ) -> BoxFuture<'static, BackendResult<SendTextOutcome>>
Uploads and sends a media message.
Sourcefn edit_message(
&self,
request: EditMessageRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn edit_message( &self, request: EditMessageRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Edits a text message.
Sourcefn delete_message(
&self,
request: DeleteMessageRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn delete_message( &self, request: DeleteMessageRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Deletes or unsends a message.
Sourcefn react(
&self,
request: ReactRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn react( &self, request: ReactRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Adds or removes a reaction.
Sourcefn read(
&self,
request: ReadRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn read( &self, request: ReadRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Marks messages read.
Sourcefn set_marked_unread(
&self,
request: SetMarkedUnreadRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn set_marked_unread( &self, request: SetMarkedUnreadRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Sets the explicit marked-unread state for a chat.
Sourcefn update_dialog_notifications(
&self,
request: UpdateDialogNotificationsRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn update_dialog_notifications( &self, request: UpdateDialogNotificationsRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Sets or clears a per-dialog notification override.
Sourcefn typing(
&self,
request: TypingRequest,
) -> BoxFuture<'static, BackendResult<OperationOutcome>>
fn typing( &self, request: TypingRequest, ) -> BoxFuture<'static, BackendResult<OperationOutcome>>
Sends a typing state.
Sourcefn receive_events(&self) -> BoxFuture<'static, BackendResult<Vec<ClientEvent>>>
fn receive_events(&self) -> BoxFuture<'static, BackendResult<Vec<ClientEvent>>>
Receives the next batch of server-pushed client events.
Provided Methods§
Sourcefn receive_event_deliveries(
&self,
) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>>
fn receive_event_deliveries( &self, ) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>>
Receives the next event batch with durable delivery identifiers when the backend supports crash-safe host acknowledgement.
Sourcefn stage_client_events(
&self,
events: Vec<ClientEvent>,
) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>>
fn stage_client_events( &self, events: Vec<ClientEvent>, ) -> BoxFuture<'static, BackendResult<Vec<ClientEventDelivery>>>
Stages locally produced operation/status events for lossless delivery.
Sourcefn acknowledge_event_delivery(
&self,
_delivery_id: u64,
) -> BoxFuture<'static, BackendResult<()>>
fn acknowledge_event_delivery( &self, _delivery_id: u64, ) -> BoxFuture<'static, BackendResult<()>>
Acknowledges one durable event after the host consumer has committed it.
Sourcefn release_event_delivery(&self, _delivery_id: u64)
fn release_event_delivery(&self, _delivery_id: u64)
Releases a process-local claim when a consumer drops a delivery without acknowledging it. The durable store entry remains pending.
Sourcefn reset_event_delivery_claims(&self) -> BoxFuture<'static, BackendResult<()>>
fn reset_event_delivery_claims(&self) -> BoxFuture<'static, BackendResult<()>>
Releases process-local delivery claims after the receiver task stops. Durable events remain in the store and can be claimed after reconnect.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".