[][src]Struct cjdns_ann::AnnouncementPacket

pub struct AnnouncementPacket(_);

Serialized announcement message. A thin wrapper over announcement packet bytes.

Implementations

impl AnnouncementPacket[src]

pub fn try_new(ann_data: Vec<u8>) -> Result<Self, PacketError>[src]

Wrap raw announcement message bytes.

Results in error if ann_data packet length is less than 120 bytes (incomplete message header).

Note

It is valid for announcement to have just header with no data.

pub fn check(&self) -> Result<(), PacketError>[src]

Checks announcement message digital signature validity. Gets signature, public signing key and signed data bytes from announcement packet and performs signature check using crypto_sign_verify_detached.

pub fn parse(self) -> Result<Announcement, PacketError>[src]

Parses announcement packet and creates deserialized announcement message, consuming this packet.

pub fn into_inner(self) -> Vec<u8>[src]

Trait Implementations

impl Clone for AnnouncementPacket[src]

impl Debug for AnnouncementPacket[src]

impl Eq for AnnouncementPacket[src]

impl PartialEq<AnnouncementPacket> for AnnouncementPacket[src]

impl StructuralEq for AnnouncementPacket[src]

impl StructuralPartialEq for AnnouncementPacket[src]

Auto Trait Implementations

impl RefUnwindSafe for AnnouncementPacket

impl Send for AnnouncementPacket

impl Sync for AnnouncementPacket

impl Unpin for AnnouncementPacket

impl UnwindSafe for AnnouncementPacket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.