pub struct NativeClient { /* private fields */ }Implementations§
Source§impl NativeClient
impl NativeClient
pub fn group_mutation_raw( &self, state: &mut AccountState, request: &GroupRpc, ) -> Result<Vec<u8>>
Source§impl NativeClient
impl NativeClient
pub fn group_detail_raw( &self, state: &mut AccountState, group: &str, ) -> Result<Vec<u8>>
Source§impl NativeClient
impl NativeClient
pub fn group_inventory( &self, state: &mut AccountState, cursor: &[u8], ) -> Result<GroupMetadataPage>
Sourcepub fn lookup_contacts_raw(
&self,
state: &mut AccountState,
ids: &[String],
) -> Result<Vec<u8>>
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.
pub fn lookup_contacts_receipt( &self, state: &mut AccountState, ids: &[String], ) -> Result<MetadataReply<ContactLookup>>
pub fn lookup_room_receipt( &self, state: &mut AccountState, id: &str, version: u32, ) -> Result<MetadataReply<RoomRoster>>
pub fn lookup_room_raw( &self, state: &mut AccountState, id: &str, version: u32, ) -> Result<Vec<u8>>
pub fn init_contacts_receipt( &self, state: &mut AccountState, a: u32, b: u32, ) -> Result<MetadataReply<InitContactPage>>
Source§impl NativeClient
impl NativeClient
Sourcepub fn logout(&self, state: &mut AccountState) -> Result<LogoutReply>
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
impl NativeClient
Sourcepub fn recall_message(
&self,
state: &mut AccountState,
recall: &MessageRecall,
) -> Result<MessageRecallReply>
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
impl NativeClient
Sourcepub fn notify_read_session(
&self,
state: &mut AccountState,
notification: &SessionReadNotification,
) -> Result<SessionReadReply>
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
impl NativeClient
pub fn new(options: NativeOptions) -> Result<Self>
pub fn push_connection(&self, state: &AccountState) -> Result<Connection>
pub fn start_qr_login( &self, device: DeviceProfile, computer_name: &str, ) -> Result<LoginAttempt>
Sourcepub fn start_profile_qr_login(
&self,
device: DeviceProfile,
computer_name: &str,
key_info: &[u8],
) -> Result<LoginAttempt>
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.
Sourcepub fn start_saved_device_login(
&self,
state: &AccountState,
computer_name: &str,
) -> Result<LoginAttempt>
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.
Sourcepub 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>
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.
pub fn poll_login(&self, attempt: &mut LoginAttempt) -> Result<LoginStatus>
Sourcepub fn poll_login_guarded(
&self,
attempt: &mut LoginAttempt,
deadline: Instant,
cancelled: impl Fn() -> bool + Send + Sync + 'static,
) -> Result<LoginStatus>
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.
pub fn complete_login(&self, attempt: &mut LoginAttempt) -> Result<AccountState>
Sourcepub fn refresh_qr_login(&self, attempt: &LoginAttempt) -> Result<LoginAttempt>
pub fn refresh_qr_login(&self, attempt: &LoginAttempt) -> Result<LoginAttempt>
Replace an expired, unscanned QR while preserving installation key-info.
Sourcepub fn renew_session(
&self,
previous: &AccountState,
computer_name: &str,
) -> Result<AccountState>
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.
pub fn sync(&self, state: &mut AccountState, cursor: &[u8]) -> Result<SyncBatch>
pub fn sync_scene( &self, state: &mut AccountState, cursor: &[u8], scene: u32, ) -> Result<SyncBatch>
pub fn heartbeat( &self, state: &mut AccountState, cursor: &[u8], ) -> Result<Heartbeat>
Sourcepub fn send_text(
&self,
state: &mut AccountState,
destination: &str,
content: &str,
created_at: u32,
client_message_id: u32,
) -> Result<TextSendResult>
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.
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>
pub fn lookup_contacts( &self, state: &mut AccountState, usernames: &[String], ) -> Result<ContactLookup>
pub fn lookup_room( &self, state: &mut AccountState, room_id: &str, version: u32, ) -> Result<RoomRoster>
pub fn init_contacts( &self, state: &mut AccountState, contact_sequence: u32, room_sequence: u32, ) -> Result<InitContactPage>
pub fn download_avatars( &self, state: &mut AccountState, usernames: &[String], ) -> Result<Vec<AvatarBytes>>
pub fn download_voice_chunk( &self, state: &mut AccountState, server_message_id: u64, total_length: u32, offset: u32, ) -> Result<VoiceChunk>
pub fn cdn_config(&self, state: &mut AccountState) -> Result<CdnConfig>
pub fn large_cdn_config( &self, state: &mut AccountState, route: LargeCdnRoute, ) -> Result<CdnConfig>
Submit a URL card once through the app-message carrier. The caller owns the durable intent and must inspect an uncertain submission outcome.
Sourcepub fn send_quote(
&self,
state: &mut AccountState,
destination: &str,
client_id: &str,
created_at: u32,
content: &str,
) -> Result<MediaSendResult>
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.
Sourcepub fn reserve_file_upload(
&self,
state: &mut AccountState,
destination: &str,
progress_client_id: &str,
file_name: &str,
plaintext_bytes: usize,
md5: &str,
) -> Result<FileUploadReservation>
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.
pub fn send_file( &self, state: &mut AccountState, destination: &str, client_id: &str, created_at: u32, upload: &UploadedMedia, ) -> Result<MediaSendResult>
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>
pub fn send_image( &self, state: &mut AccountState, destination: &str, client_id: &str, upload: &UploadedImage, ) -> Result<MediaSendResult>
pub fn send_video( &self, state: &mut AccountState, destination: &str, client_id: &str, upload: &UploadedVideo, play_seconds: u32, ) -> Result<MediaSendResult>
Sourcepub fn send_voice(
&self,
state: &mut AccountState,
destination: &str,
client_id: &str,
created_at: u32,
duration_ms: u32,
encoded: &[u8],
) -> Result<MediaSendResult>
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.