pub struct Announce<'a> {
pub destination: DestinationHash,
pub public_keys: IdentityPublicKeys,
pub dotted_name_hash: DottedNameHash,
pub announce_id: AnnounceId,
pub ratchet: Option<RatchetKey>,
pub signature: Ed25519Signature,
pub app_data: &'a [u8],
}Fields§
§destination: DestinationHash§public_keys: IdentityPublicKeys§dotted_name_hash: DottedNameHash§announce_id: AnnounceId§ratchet: Option<RatchetKey>§signature: Ed25519Signature§app_data: &'a [u8]Implementations§
Source§impl<'a> Announce<'a>
impl<'a> Announce<'a>
pub fn from_wire( header: &WirePacketHeader, payload: &'a [u8], ) -> Result<Announce<'a>, AnnounceValidationError>
Sourcepub fn from_wire_unverified(
header: &WirePacketHeader,
payload: &'a [u8],
) -> Result<Announce<'a>, AnnounceValidationError>
pub fn from_wire_unverified( header: &WirePacketHeader, payload: &'a [u8], ) -> Result<Announce<'a>, AnnounceValidationError>
Splits out the Ed25519 verify, the one heavy step, so it can run inline or off the manifold on the crypto pool.
Sourcepub fn signature_is_valid(&self) -> bool
pub fn signature_is_valid(&self) -> bool
The heavy step, separated. When available, the crypto pool runs it off the manifold on a Self::from_wire_unverified-parsed announce, otherwise Self::from_wire runs both steps inline.
pub fn build_signed( signer: &impl IdentitySigner, dotted_name_hash: DottedNameHash, announce_id: AnnounceId, ratchet: Option<RatchetKey>, app_data: &'a [u8], ) -> Result<Announce<'a>, AnnounceBuildError>
pub fn wire_bytes(&self) -> usize
pub fn to_wire(&self, buf: &mut [u8]) -> Result<usize, BufferTooShort>
Trait Implementations§
impl<'a> Eq for Announce<'a>
impl<'a> StructuralPartialEq for Announce<'a>
Auto Trait Implementations§
impl<'a> Freeze for Announce<'a>
impl<'a> RefUnwindSafe for Announce<'a>
impl<'a> Send for Announce<'a>
impl<'a> Sync for Announce<'a>
impl<'a> Unpin for Announce<'a>
impl<'a> UnsafeUnpin for Announce<'a>
impl<'a> UnwindSafe for Announce<'a>
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