pub struct PushService { /* private fields */ }
Implementations§
Source§impl PushService
impl PushService
Sourcepub async fn whoami(&mut self) -> Result<WhoAmIResponse, ServiceError>
pub async fn whoami(&mut self) -> Result<WhoAmIResponse, ServiceError>
Method used to check our own UUID
Sourcepub async fn devices(&mut self) -> Result<Vec<DeviceInfo>, ServiceError>
pub async fn devices(&mut self) -> Result<Vec<DeviceInfo>, ServiceError>
Fetches a list of all devices tied to the authenticated account.
This list include the device that sends the request.
pub async fn set_account_attributes( &mut self, attributes: AccountAttributes, ) -> Result<(), ServiceError>
Source§impl PushService
impl PushService
pub async fn get_attachment( &mut self, ptr: &AttachmentPointer, ) -> Result<impl AsyncRead + Send + Unpin, ServiceError>
pub async fn upload_to_cdn0( &mut self, path: &str, upload_attributes: AttachmentV2UploadAttributes, filename: String, reader: impl Read + Send, ) -> Result<(), ServiceError>
Source§impl PushService
impl PushService
pub async fn get_pre_key_status( &mut self, service_id_kind: ServiceIdKind, ) -> Result<PreKeyStatus, ServiceError>
Sourcepub async fn check_pre_keys(
&mut self,
service_id_kind: ServiceIdKind,
digest: &[u8; 32],
) -> Result<bool, ServiceError>
pub async fn check_pre_keys( &mut self, service_id_kind: ServiceIdKind, digest: &[u8; 32], ) -> Result<bool, ServiceError>
Checks for consistency of the repeated-use keys
Supply the digest as follows:
SHA256(identityKeyBytes || signedEcPreKeyId || signedEcPreKeyIdBytes || lastResortKeyId || lastResortKeyBytes)
The IDs are represented as 8-byte big endian ints.
Retuns Ok(true)
if the view is consistent, Ok(false)
if the view is inconsistent.
pub async fn register_pre_keys( &mut self, service_id_kind: ServiceIdKind, pre_key_state: PreKeyState, ) -> Result<(), ServiceError>
pub async fn get_pre_key( &mut self, destination: &ServiceId, device_id: u32, ) -> Result<PreKeyBundle, ServiceError>
pub async fn get_sender_certificate( &mut self, ) -> Result<SenderCertificate, ServiceError>
pub async fn get_uuid_only_sender_certificate( &mut self, ) -> Result<SenderCertificate, ServiceError>
pub async fn distribute_pni_keys( &mut self, pni_identity_key: &IdentityKey, device_messages: Vec<OutgoingPushMessage>, device_pni_signed_prekeys: HashMap<String, SignedPreKeyEntity>, device_pni_last_resort_kyber_prekeys: HashMap<String, KyberPreKeyEntity>, pni_registration_ids: HashMap<String, u32>, signature_valid_on_each_signed_pre_key: bool, ) -> Result<VerifyAccountResponse, ServiceError>
Source§impl PushService
impl PushService
pub async fn link_device( &mut self, link_request: &LinkRequest, http_auth: HttpAuth, ) -> Result<LinkResponse, ServiceError>
pub async fn unlink_device(&mut self, id: i64) -> Result<(), ServiceError>
Source§impl PushService
impl PushService
pub async fn retrieve_profile_by_id( &mut self, address: Aci, profile_key: Option<ProfileKey>, ) -> Result<SignalServiceProfile, ServiceError>
pub async fn retrieve_profile_avatar( &mut self, path: &str, ) -> Result<impl AsyncRead + Send + Unpin, ServiceError>
pub async fn retrieve_groups_v2_profile_avatar( &mut self, path: &str, ) -> Result<impl AsyncRead + Send + Unpin, ServiceError>
Sourcepub async fn write_profile<'s, C, S>(
&mut self,
version: &ProfileKeyVersion,
name: &[u8],
about: &[u8],
emoji: &[u8],
commitment: &ProfileKeyCommitment,
avatar: AvatarWrite<&mut C>,
) -> Result<Option<String>, ServiceError>
pub async fn write_profile<'s, C, S>( &mut self, version: &ProfileKeyVersion, name: &[u8], about: &[u8], emoji: &[u8], commitment: &ProfileKeyCommitment, avatar: AvatarWrite<&mut C>, ) -> Result<Option<String>, ServiceError>
Writes a profile and returns the avatar URL, if one was provided.
The name, about and emoji fields are encrypted with an ProfileCipher
.
See AccountManager
for a convenience method.
Java equivalent: writeProfile
Source§impl PushService
impl PushService
pub async fn submit_registration_request( &mut self, registration_method: RegistrationMethod<'_>, account_attributes: AccountAttributes, skip_device_transfer: bool, aci_identity_key: &IdentityKey, pni_identity_key: &IdentityKey, device_activation_request: DeviceActivationRequest, ) -> Result<VerifyAccountResponse, ServiceError>
pub async fn create_verification_session<'a>( &mut self, number: &'a str, push_token: Option<&'a str>, mcc: Option<&'a str>, mnc: Option<&'a str>, ) -> Result<RegistrationSessionMetadataResponse, ServiceError>
pub async fn patch_verification_session<'a>( &mut self, session_id: &'a str, push_token: Option<&'a str>, mcc: Option<&'a str>, mnc: Option<&'a str>, captcha: Option<&'a str>, push_challenge: Option<&'a str>, ) -> Result<RegistrationSessionMetadataResponse, ServiceError>
Sourcepub async fn request_verification_code(
&mut self,
session_id: &str,
client: &str,
transport: VerificationTransport,
) -> Result<RegistrationSessionMetadataResponse, ServiceError>
pub async fn request_verification_code( &mut self, session_id: &str, client: &str, transport: VerificationTransport, ) -> Result<RegistrationSessionMetadataResponse, ServiceError>
Request a verification code.
Signal requires a client type, and they use these three strings internally:
- “android-2021-03”
- “android”
- “ios”
“android-2021-03” allegedly implies FCM support, whereas the other strings don’t. In principle, they will consider any string as “unknown”, so other strings may work too.
pub async fn submit_verification_code( &mut self, session_id: &str, verification_code: &str, ) -> Result<RegistrationSessionMetadataResponse, ServiceError>
Source§impl PushService
impl PushService
pub async fn get_sticker_pack_manifest( &mut self, id: &str, ) -> Result<impl AsyncRead + Send + Unpin, ServiceError>
pub async fn get_sticker( &mut self, pack_id: &str, sticker_id: u32, ) -> Result<impl AsyncRead + Send + Unpin, ServiceError>
Source§impl PushService
impl PushService
pub fn new( cfg: impl Into<ServiceConfiguration>, credentials: Option<ServiceCredentials>, user_agent: impl AsRef<str>, ) -> Self
pub fn request( &self, method: Method, endpoint: Endpoint<'_>, auth_override: HttpAuthOverride, ) -> Result<RequestBuilder, ServiceError>
pub async fn ws( &mut self, path: &str, keepalive_path: &str, additional_headers: &[(&'static str, &str)], credentials: Option<ServiceCredentials>, ) -> Result<SignalWebSocket, ServiceError>
Trait Implementations§
Source§impl Clone for PushService
impl Clone for PushService
Source§fn clone(&self) -> PushService
fn clone(&self) -> PushService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PushService
impl !RefUnwindSafe for PushService
impl Send for PushService
impl Sync for PushService
impl Unpin for PushService
impl !UnwindSafe for PushService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more