Skip to main content

InlineClient

Struct InlineClient 

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

Cheap cloneable handle for apps, bridges, agents, and tests.

Implementations§

Source§

impl InlineClient

Source

pub fn builder() -> InlineClientBuilder

Creates a default client runtime builder.

Source

pub fn status(&self) -> ClientStatus

Returns the latest observed client status.

Source

pub fn status_snapshot(&self) -> ClientStatusSnapshot

Returns the latest observed status snapshot.

Source

pub fn subscribe(&self) -> Receiver<ClientEvent>

Subscribes to committed client events.

Source

pub fn take_lossless_events(&self) -> Option<LosslessEventReceiver>

Claims the single bounded lossless event stream.

Once claimed, the runner applies backpressure before accepting more work rather than dropping lossless events. Broadcast subscribers remain independent and may still observe lag errors. Returns None after the lossless stream has already been claimed.

Source

pub async fn auth_start( &self, request: AuthStartRequest, ) -> Result<AuthStartResult, ClientRequestError>

Sends an Inline login code.

Source

pub async fn auth_verify( &self, request: AuthVerifyRequest, ) -> Result<AuthVerifyResult, ClientRequestError>

Verifies an Inline login code and persists the resulting session.

Source

pub async fn resume_session( &self, ) -> Result<ClientStatusSnapshot, ClientRequestError>

Resumes a previously stored session, if available.

Source

pub async fn connect( &self, request: ConnectRequest, ) -> Result<ClientStatusSnapshot, ClientRequestError>

Connects or reconnects the client.

Source

pub async fn logout(&self) -> Result<(), ClientRequestError>

Logs out the current account.

Source

pub async fn dialogs( &self, request: DialogsRequest, ) -> Result<DialogsPage, ClientRequestError>

Lists dialogs.

Source

pub async fn cached_dialogs( &self, request: DialogsRequest, ) -> Result<DialogsPage, ClientRequestError>

Lists only durable cached dialogs without making a network request.

Source

pub async fn account_state( &self, ) -> Result<AccountStateSnapshot, ClientRequestError>

Loads account-level durable state for recovery after a consumer event stream retention gap.

Source

pub async fn chat_state( &self, chat_id: InlineId, ) -> Result<ChatStateSnapshot, ClientRequestError>

Loads durable state for one chat. Current messages remain paged through Self::history so large accounts do not require an unbounded snapshot.

Source

pub async fn history( &self, request: HistoryRequest, ) -> Result<HistoryPage, ClientRequestError>

Fetches chat history.

Source

pub async fn cached_history( &self, request: HistoryRequest, ) -> Result<HistoryPage, ClientRequestError>

Fetches only durable locally cached history without a network request.

Source

pub async fn chat_participants( &self, request: ChatParticipantsRequest, ) -> Result<ChatParticipantsPage, ClientRequestError>

Fetches chat participants.

Source

pub async fn add_chat_participant( &self, request: AddChatParticipantRequest, ) -> Result<(), ClientRequestError>

Adds a user to an Inline chat.

Source

pub async fn remove_chat_participant( &self, request: RemoveChatParticipantRequest, ) -> Result<(), ClientRequestError>

Removes a user from an Inline chat.

Source

pub async fn update_chat_info( &self, request: UpdateChatInfoRequest, ) -> Result<(), ClientRequestError>

Updates mutable Inline chat metadata.

Source

pub async fn delete_chat( &self, request: DeleteChatRequest, ) -> Result<(), ClientRequestError>

Deletes an Inline chat when permitted by the service.

Source

pub async fn create_dm( &self, request: CreateDmRequest, ) -> Result<CreatedChat, ClientRequestError>

Creates or opens a direct message chat.

Source

pub async fn create_thread( &self, request: CreateThreadRequest, ) -> Result<CreatedChat, ClientRequestError>

Creates a regular Inline thread chat.

Source

pub async fn create_reply_thread( &self, request: CreateReplyThreadRequest, ) -> Result<CreatedChat, ClientRequestError>

Creates a child/reply Inline thread chat.

Source

pub async fn send_text( &self, request: SendTextRequest, ) -> Result<MessageMutation, ClientRequestError>

Sends a text message.

Source

pub async fn send_media( &self, request: UploadRequest, bytes: Vec<u8>, ) -> Result<MessageMutation, ClientRequestError>

Uploads and sends a media message.

Source

pub async fn edit_message( &self, request: EditMessageRequest, ) -> Result<(), ClientRequestError>

Edits a text message.

Source

pub async fn delete_message( &self, request: DeleteMessageRequest, ) -> Result<(), ClientRequestError>

Deletes or unsends a message.

Source

pub async fn react( &self, request: ReactRequest, ) -> Result<(), ClientRequestError>

Adds or removes a reaction.

Source

pub async fn read(&self, request: ReadRequest) -> Result<(), ClientRequestError>

Marks messages read.

Source

pub async fn set_marked_unread( &self, request: SetMarkedUnreadRequest, ) -> Result<(), ClientRequestError>

Sets the explicit marked-unread state for a chat.

Source

pub async fn update_dialog_notifications( &self, request: UpdateDialogNotificationsRequest, ) -> Result<(), ClientRequestError>

Sets or clears a per-dialog notification override.

Source

pub async fn typing( &self, request: TypingRequest, ) -> Result<(), ClientRequestError>

Sends a typing state.

Source

pub async fn set_status( &self, status: ClientStatus, failure: Option<ClientFailure>, ) -> Result<(), ClientCommandError>

Updates status through the runner.

This is public so early hosts and tests can exercise the event/status pipeline before the real transport manager is wired in. Future transport code should call the same internal command path.

Source

pub async fn shutdown(&self) -> Result<(), ClientCommandError>

Requests runner shutdown.

Trait Implementations§

Source§

impl Clone for InlineClient

Source§

fn clone(&self) -> InlineClient

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
Source§

impl Debug for InlineClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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