Trait libsignal_service::prelude::ProtobufMessage

source ·
pub trait ProtobufMessage: Debug + Send + Sync {
    // Required methods
    fn encoded_len(&self) -> usize;
    fn clear(&mut self);

    // Provided methods
    fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
       where Self: Sized { ... }
    fn encode_to_vec(&self) -> Vec<u8> 
       where Self: Sized { ... }
    fn encode_length_delimited(
        &self,
        buf: &mut impl BufMut,
    ) -> Result<(), EncodeError>
       where Self: Sized { ... }
    fn encode_length_delimited_to_vec(&self) -> Vec<u8> 
       where Self: Sized { ... }
    fn decode(buf: impl Buf) -> Result<Self, DecodeError>
       where Self: Default { ... }
    fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
       where Self: Default { ... }
    fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
       where Self: Sized { ... }
    fn merge_length_delimited(
        &mut self,
        buf: impl Buf,
    ) -> Result<(), DecodeError>
       where Self: Sized { ... }
}
Expand description

A Protocol Buffers message.

Required Methods§

source

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.

source

fn clear(&mut self)

Clears the message, resetting all fields to their default.

Provided Methods§

source

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer.

An error will be returned if the buffer does not have sufficient capacity.

source

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.

source

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer.

An error will be returned if the buffer does not have sufficient capacity.

source

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.

source

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer.

The entire buffer will be consumed.

source

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.

source

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self.

The entire buffer will be consumed.

source

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.

Implementations on Foreign Types§

source§

impl Message for bool

google.protobuf.BoolValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for f32

google.protobuf.FloatValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for f64

google.protobuf.DoubleValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for i32

google.protobuf.Int32Value

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for i64

google.protobuf.Int64Value

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for u32

google.protobuf.UInt32Value

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for u64

google.protobuf.UInt64Value

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for ()

google.protobuf.Empty

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for String

google.protobuf.StringValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for Vec<u8>

google.protobuf.BytesValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl Message for Bytes

google.protobuf.BytesValue

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

source§

impl<M> Message for Box<M>
where M: Message,

source§

fn encoded_len(&self) -> usize

source§

fn clear(&mut self)

Implementors§

source§

impl Message for Answer

source§

impl Message for Busy

source§

impl Message for Hangup

source§

impl Message for IceUpdate

source§

impl Message for Offer

source§

impl Message for Opaque

source§

impl Message for libsignal_service::proto::contact_details::Avatar

source§

impl Message for libsignal_service::proto::data_message::contact::Avatar

source§

impl Message for Email

source§

impl Message for Name

source§

impl Message for Phone

source§

impl Message for PostalAddress

source§

impl Message for libsignal_service::proto::data_message::payment::amount::MobileCoin

source§

impl Message for libsignal_service::proto::data_message::payment::notification::MobileCoin

source§

impl Message for Activation

source§

impl Message for Amount

source§

impl Message for Notification

source§

impl Message for QuotedAttachment

source§

impl Message for Contact

source§

impl Message for Delete

source§

impl Message for GiftBadge

source§

impl Message for GroupCallUpdate

source§

impl Message for Payment

source§

impl Message for Quote

source§

impl Message for Reaction

source§

impl Message for libsignal_service::proto::data_message::Sticker

source§

impl Message for StoryContext

source§

impl Message for AddBannedMemberAction

source§

impl Message for AddMemberAction

source§

impl Message for AddPendingMemberAction

source§

impl Message for AddRequestingMemberAction

source§

impl Message for DeleteBannedMemberAction

source§

impl Message for DeleteMemberAction

source§

impl Message for DeletePendingMemberAction

source§

impl Message for DeleteRequestingMemberAction

source§

impl Message for ModifyAddFromInviteLinkAccessControlAction

source§

impl Message for ModifyAnnouncementsOnlyAction

source§

impl Message for ModifyAttributesAccessControlAction

source§

impl Message for ModifyAvatarAction

source§

impl Message for ModifyDescriptionAction

source§

impl Message for ModifyDisappearingMessagesTimerAction

source§

impl Message for ModifyInviteLinkPasswordAction

source§

impl Message for ModifyMemberProfileKeyAction

source§

impl Message for ModifyMemberRoleAction

source§

impl Message for ModifyMembersAccessControlAction

source§

impl Message for ModifyTitleAction

source§

impl Message for PromotePendingMemberAction

source§

impl Message for PromotePendingPniAciMemberProfileKeyAction

source§

impl Message for PromoteRequestingMemberAction

source§

impl Message for Actions

source§

impl Message for GroupChangeState

source§

impl Message for libsignal_service::proto::group_context::Member

source§

impl Message for libsignal_service::proto::group_details::Avatar

source§

impl Message for libsignal_service::proto::group_details::Member

source§

impl Message for GroupInviteLinkContentsV1

source§

impl Message for libsignal_service::proto::pack::Sticker

source§

impl Message for MobileCoinAddress

source§

impl Message for libsignal_service::proto::sender_certificate::Certificate

source§

impl Message for libsignal_service::proto::server_certificate::Certificate

source§

impl Message for AccessControl

source§

impl Message for AttachmentPointer

source§

impl Message for AvatarUploadAttributes

source§

impl Message for BannedMember

source§

impl Message for BodyRange

source§

impl Message for CallMessage

source§

impl Message for ContactDetails

source§

impl Message for Content

source§

impl Message for DataMessage

source§

impl Message for DecryptionErrorMessage

source§

impl Message for DeviceName

source§

impl Message for EditMessage

source§

impl Message for Envelope

source§

impl Message for Group

source§

impl Message for GroupAttributeBlob

source§

impl Message for GroupChange

source§

impl Message for GroupChangeResponse

source§

impl Message for GroupChanges

source§

impl Message for GroupContext

source§

impl Message for GroupContextV2

source§

impl Message for GroupDetails

source§

impl Message for GroupExternalCredential

source§

impl Message for GroupJoinInfo

source§

impl Message for GroupResponse

source§

impl Message for libsignal_service::proto::Member

source§

impl Message for NullMessage

source§

impl Message for Pack

source§

impl Message for PaymentAddress

source§

impl Message for PendingMember

source§

impl Message for PniSignatureMessage

source§

impl Message for Preview

source§

impl Message for ProvisionEnvelope

source§

impl Message for ProvisionMessage

source§

impl Message for ProvisioningUuid

source§

impl Message for ReceiptMessage

source§

impl Message for RequestingMember

source§

impl Message for SenderCertificate

source§

impl Message for ServerCertificate

source§

impl Message for StoryMessage

source§

impl Message for SyncMessage

source§

impl Message for TextAttachment

source§

impl Message for TypingMessage

source§

impl Message for UnidentifiedSenderMessage

source§

impl Message for Verified

source§

impl Message for WebSocketMessage

source§

impl Message for WebSocketRequestMessage

source§

impl Message for WebSocketResponseMessage

source§

impl Message for AddressableMessage

source§

impl Message for AttachmentDelete

source§

impl Message for ConversationDelete

source§

impl Message for ConversationIdentifier

source§

impl Message for LocalOnlyConversationDelete

source§

impl Message for MessageDeletes

source§

impl Message for libsignal_service::proto::sync_message::outgoing_payment::MobileCoin

source§

impl Message for StoryMessageRecipient

source§

impl Message for UnidentifiedDeliveryStatus

source§

impl Message for Blocked

source§

impl Message for CallEvent

source§

impl Message for CallLinkUpdate

source§

impl Message for CallLogEvent

source§

impl Message for Configuration

source§

impl Message for Contacts

source§

impl Message for DeleteForMe

source§

impl Message for FetchLatest

source§

impl Message for Keys

source§

impl Message for MessageRequestResponse

source§

impl Message for OutgoingPayment

source§

impl Message for PniChangeNumber

source§

impl Message for Read

source§

impl Message for Request

source§

impl Message for Sent

source§

impl Message for StickerPackOperation

source§

impl Message for ViewOnceOpen

source§

impl Message for Viewed

source§

impl Message for Gradient

source§

impl Message for Message