pub struct Packet { /* private fields */ }Expand description
Contains no node IDs, names, public keys, plaintext, or chat request IDs. Opaque group IDs, sequence counters, predecessor hashes and sizes are visible.
Implementations§
Source§impl Packet
impl Packet
pub fn encode_compact(&self) -> Result<Vec<u8>>
pub fn decode_compact(bytes: &[u8]) -> Result<Self>
Source§impl Packet
impl Packet
pub fn group(&self) -> &[u8] ⓘ
pub fn sequence(&self) -> u64
pub fn previous(&self) -> Digest
pub fn ciphertext(&self) -> &[u8] ⓘ
Sourcepub fn digest(&self) -> Result<Digest>
pub fn digest(&self) -> Result<Digest>
Digest excludes the deterministic detached signature, matching authority records.
Sourcepub fn verify(&self, key: &PublicKey) -> Result<()>
pub fn verify(&self, key: &PublicKey) -> Result<()>
The key must come from fresh owner-approved membership and the saved stream pin.
pub fn encode(&self) -> Result<Vec<u8>>
pub fn decode(wire: &[u8]) -> Result<Self>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Packet
impl<'de> Deserialize<'de> for Packet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Packet
impl StructuralPartialEq for Packet
Auto Trait Implementations§
impl Forget for Packet
impl Freeze for Packet
impl Move for Packet
impl RefUnwindSafe for Packet
impl Send for Packetwhere
RawVecInner: Send,
impl Sync for Packetwhere
RawVecInner: Sync,
impl Unpin for Packet
impl UnsafeUnpin for Packet
impl UnwindSafe for Packetwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more