Struct libsignal_service::proto::Envelope
source · pub struct Envelope {
pub type: Option<i32>,
pub source_service_id: Option<String>,
pub source_device: Option<u32>,
pub destination_service_id: Option<String>,
pub timestamp: Option<u64>,
pub content: Option<Vec<u8>>,
pub server_guid: Option<String>,
pub server_timestamp: Option<u64>,
pub urgent: Option<bool>,
pub story: Option<bool>,
pub reporting_token: Option<Vec<u8>>,
}
Fields§
§type: Option<i32>
§source_service_id: Option<String>
§source_device: Option<u32>
§destination_service_id: Option<String>
§timestamp: Option<u64>
§content: Option<Vec<u8>>
Contains an encrypted Content
server_guid: Option<String>
§server_timestamp: Option<u64>
§urgent: Option<bool>
§story: Option<bool>
§reporting_token: Option<Vec<u8>>
Implementations§
source§impl Envelope
impl Envelope
pub fn decrypt( input: &[u8], signaling_key: Option<&SignalingKey>, is_signaling_key_encrypted: bool, ) -> Result<Self, ServiceError>
pub fn is_unidentified_sender(&self) -> bool
pub fn is_prekey_signal_message(&self) -> bool
pub fn is_receipt(&self) -> bool
pub fn is_signal_message(&self) -> bool
pub fn is_urgent(&self) -> bool
pub fn is_story(&self) -> bool
pub fn source_address(&self) -> ServiceAddress
pub fn destination_address(&self) -> ServiceAddress
source§impl Envelope
impl Envelope
sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn timestamp(&self) -> u64
pub fn timestamp(&self) -> u64
Returns the value of timestamp
, or the default value if timestamp
is unset.
sourcepub fn source_device(&self) -> u32
pub fn source_device(&self) -> u32
Returns the value of source_device
, or the default value if source_device
is unset.
sourcepub fn content(&self) -> &[u8] ⓘ
pub fn content(&self) -> &[u8] ⓘ
Returns the value of content
, or the default value if content
is unset.
sourcepub fn server_guid(&self) -> &str
pub fn server_guid(&self) -> &str
Returns the value of server_guid
, or the default value if server_guid
is unset.
sourcepub fn server_timestamp(&self) -> u64
pub fn server_timestamp(&self) -> u64
Returns the value of server_timestamp
, or the default value if server_timestamp
is unset.
sourcepub fn source_service_id(&self) -> &str
pub fn source_service_id(&self) -> &str
Returns the value of source_service_id
, or the default value if source_service_id
is unset.
sourcepub fn destination_service_id(&self) -> &str
pub fn destination_service_id(&self) -> &str
Returns the value of destination_service_id
, or the default value if destination_service_id
is unset.
sourcepub fn urgent(&self) -> bool
pub fn urgent(&self) -> bool
Returns the value of urgent
, or the default value if urgent
is unset.
sourcepub fn story(&self) -> bool
pub fn story(&self) -> bool
Returns the value of story
, or the default value if story
is unset.
sourcepub fn reporting_token(&self) -> &[u8] ⓘ
pub fn reporting_token(&self) -> &[u8] ⓘ
Returns the value of reporting_token
, or the default value if reporting_token
is unset.
Trait Implementations§
source§impl Message for Envelope
impl Message for Envelope
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Envelope
impl PartialEq for Envelope
source§impl TryFrom<EnvelopeEntity> for Envelope
impl TryFrom<EnvelopeEntity> for Envelope
§type Error = ParseServiceAddressError
type Error = ParseServiceAddressError
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnwindSafe for Envelope
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
§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> 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