Skip to main content

NativeClient

Struct NativeClient 

Source
pub struct NativeClient { /* private fields */ }

Implementations§

Source§

impl NativeClient

Source

pub fn group_mutation_raw( &self, state: &mut AccountState, request: &GroupRpc, ) -> Result<Vec<u8>>

Source§

impl NativeClient

Source

pub fn group_detail_raw( &self, state: &mut AccountState, group: &str, ) -> Result<Vec<u8>>

Source§

impl NativeClient

Source

pub fn group_inventory( &self, state: &mut AccountState, cursor: &[u8], ) -> Result<GroupMetadataPage>

Source

pub fn lookup_contacts_raw( &self, state: &mut AccountState, ids: &[String], ) -> Result<Vec<u8>>

Verified native business payload, retained before strict contact decoding. Callers must protect this account data at rest. The transport’s global message bound applies; no identities or opaque fields are exposed in logs.

Source

pub fn lookup_contacts_receipt( &self, state: &mut AccountState, ids: &[String], ) -> Result<MetadataReply<ContactLookup>>

Source

pub fn lookup_room_receipt( &self, state: &mut AccountState, id: &str, version: u32, ) -> Result<MetadataReply<RoomRoster>>

Source

pub fn lookup_room_raw( &self, state: &mut AccountState, id: &str, version: u32, ) -> Result<Vec<u8>>

Source

pub fn init_contacts_receipt( &self, state: &mut AccountState, a: u32, b: u32, ) -> Result<MetadataReply<InitContactPage>>

Source§

impl NativeClient

Source

pub fn logout(&self, state: &mut AccountState) -> Result<LogoutReply>

Submit one authenticated logout without renewal, retry or login fallback. An error can follow submission and must be treated as an unknown outcome.

Source§

impl NativeClient

Source

pub fn recall_message( &self, state: &mut AccountState, recall: &MessageRecall, ) -> Result<MessageRecallReply>

Submit once without credential renewal, login fallback or automatic retry.

Source§

impl NativeClient

Source

pub fn notify_read_session( &self, state: &mut AccountState, notification: &SessionReadNotification, ) -> Result<SessionReadReply>

Submit once, with no renewal, retry, or login fallback. A caller must retain the boundary and request identity before invoking this method.

Source§

impl NativeClient

Source

pub fn new(options: NativeOptions) -> Result<Self>

Source

pub fn push_connection(&self, state: &AccountState) -> Result<Connection>

Source

pub fn start_qr_login( &self, device: DeviceProfile, computer_name: &str, ) -> Result<LoginAttempt>

Source

pub fn start_profile_qr_login( &self, device: DeviceProfile, computer_name: &str, key_info: &[u8], ) -> Result<LoginAttempt>

QR approval for an existing installation retains its selected key-info. This neither bypasses phone approval nor imports active authorization.

Source

pub fn start_saved_device_login( &self, state: &AccountState, computer_name: &str, ) -> Result<LoginAttempt>

Initiates phone approval for an existing remembered device without a QR. The caller chooses this fallback explicitly; no automatic auth retries occur.

Source

pub fn start_profile_saved_device_login( &self, device: &DeviceProfile, username: &str, auto_auth_key: &[u8], cookie: &[u8], key_info: &[u8], computer_name: &str, ) -> Result<LoginAttempt>

Use remembered official-profile trust without inventing active session keys.

Source

pub fn poll_login(&self, attempt: &mut LoginAttempt) -> Result<LoginStatus>

Source

pub fn poll_login_guarded( &self, attempt: &mut LoginAttempt, deadline: Instant, cancelled: impl Fn() -> bool + Send + Sync + 'static, ) -> Result<LoginStatus>

The guard bounds the temporary LAN listener even while a blocking poll or upload is in flight. It must not perform blocking work itself.

Source

pub fn complete_login(&self, attempt: &mut LoginAttempt) -> Result<AccountState>

Source

pub fn refresh_qr_login(&self, attempt: &LoginAttempt) -> Result<LoginAttempt>

Replace an expired, unscanned QR while preserving installation key-info.

Source

pub fn renew_session( &self, previous: &AccountState, computer_name: &str, ) -> Result<AccountState>

One trusted AutoAuth exchange, retaining identity and replacing selected key sections atomically in the returned value. Does not silently fall back to QR.

Source

pub fn sync(&self, state: &mut AccountState, cursor: &[u8]) -> Result<SyncBatch>

Source

pub fn sync_scene( &self, state: &mut AccountState, cursor: &[u8], scene: u32, ) -> Result<SyncBatch>

Source

pub fn heartbeat( &self, state: &mut AccountState, cursor: &[u8], ) -> Result<Heartbeat>

Source

pub fn send_text( &self, state: &mut AccountState, destination: &str, content: &str, created_at: u32, client_message_id: u32, ) -> Result<TextSendResult>

Submit exactly once. An I/O error after submission is an uncertain outcome; services must persist the intent and must not automatically retry this call.

Source

pub fn send_text_with_source( &self, state: &mut AccountState, destination: &str, content: &str, created_at: u32, client_message_id: u32, source: Option<&str>, ) -> Result<TextSendResult>

Source

pub fn lookup_contacts( &self, state: &mut AccountState, usernames: &[String], ) -> Result<ContactLookup>

Source

pub fn lookup_room( &self, state: &mut AccountState, room_id: &str, version: u32, ) -> Result<RoomRoster>

Source

pub fn init_contacts( &self, state: &mut AccountState, contact_sequence: u32, room_sequence: u32, ) -> Result<InitContactPage>

Source

pub fn download_avatars( &self, state: &mut AccountState, usernames: &[String], ) -> Result<Vec<AvatarBytes>>

Source

pub fn download_voice_chunk( &self, state: &mut AccountState, server_message_id: u64, total_length: u32, offset: u32, ) -> Result<VoiceChunk>

Source

pub fn cdn_config(&self, state: &mut AccountState) -> Result<CdnConfig>

Source

pub fn large_cdn_config( &self, state: &mut AccountState, route: LargeCdnRoute, ) -> Result<CdnConfig>

Source

pub fn send_share( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, content: &str, ) -> Result<MediaSendResult>

Submit a URL card once through the app-message carrier. The caller owns the durable intent and must inspect an uncertain submission outcome.

Source

pub fn send_quote( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, content: &str, ) -> Result<MediaSendResult>

Submit a quoted reply once. The caller owns the persisted XML, intent and uncertain-submission handling, as for other app-message sends.

Source

pub fn reserve_file_upload( &self, state: &mut AccountState, destination: &str, progress_client_id: &str, file_name: &str, plaintext_bytes: usize, md5: &str, ) -> Result<FileUploadReservation>

Reserve one file-upload message. An uncertain response must not be retried automatically; retain the returned receipt with the send intent.

Source

pub fn send_file( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, upload: &UploadedMedia, ) -> Result<MediaSendResult>

Source

pub fn send_file_with_reservation( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, upload: &UploadedMedia, reservation: Option<&FileUploadReservation>, ) -> Result<MediaSendResult>

Source

pub fn send_image( &self, state: &mut AccountState, destination: &str, client_id: &str, upload: &UploadedImage, ) -> Result<MediaSendResult>

Source

pub fn send_video( &self, state: &mut AccountState, destination: &str, client_id: &str, upload: &UploadedVideo, play_seconds: u32, ) -> Result<MediaSendResult>

Source

pub fn send_voice( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, duration_ms: u32, encoded: &[u8], ) -> Result<MediaSendResult>

Submit one voice note, as consecutive byte ranges when it exceeds one request. Each range is sent once; an error after the first submission is an uncertain outcome that the caller must not retry automatically.

Source§

impl NativeClient

Source

pub fn contact_sync( &self, state: &mut AccountState, cursor: &[u8], message_cursor: &[u8], continuation: bool, ) -> Result<ContactSyncBatch>

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<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, 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<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