pub struct OpaqueAdvertisement { /* private fields */ }Expand description
A LAN peering advertisement: an opaque, rotating service-instance name plus the TCP port the device listens on. The name is derived purely from a per-device rotation secret and a rotation epoch, so structurally there is no user handle or device name to leak.
Implementations§
Source§impl OpaqueAdvertisement
impl OpaqueAdvertisement
Sourcepub fn for_epoch(
rotation_seed: &[u8; 32],
epoch: RotationEpoch,
port: u16,
) -> Self
pub fn for_epoch( rotation_seed: &[u8; 32], epoch: RotationEpoch, port: u16, ) -> Self
Derive the advertisement for a rotation epoch (see rotation_epoch). The instance
name is hex(SHA-256("capsule-peer-advert-v2" ‖ rotation_seed ‖ boot_id ‖ day)[..16]) —
a one-way function of a secret the peer never broadcasts, so the same epoch reproduces the
same opaque name and a new epoch (a new boot, or a new UTC day) yields an unlinkable new
one. Hashing the two components separately means no two distinct epochs can collide.
Sourcepub fn advertised_name(&self) -> &str
pub fn advertised_name(&self) -> &str
The opaque service-instance name that goes on the wire. Carries no identity.
Sourcepub fn service_type(&self) -> &'static str
pub fn service_type(&self) -> &'static str
The fixed, non-identifying mDNS service type.
Trait Implementations§
Source§impl Clone for OpaqueAdvertisement
impl Clone for OpaqueAdvertisement
Source§fn clone(&self) -> OpaqueAdvertisement
fn clone(&self) -> OpaqueAdvertisement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpaqueAdvertisement
impl Debug for OpaqueAdvertisement
impl Eq for OpaqueAdvertisement
Source§impl PartialEq for OpaqueAdvertisement
impl PartialEq for OpaqueAdvertisement
Source§fn eq(&self, other: &OpaqueAdvertisement) -> bool
fn eq(&self, other: &OpaqueAdvertisement) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OpaqueAdvertisement
Auto Trait Implementations§
impl Freeze for OpaqueAdvertisement
impl RefUnwindSafe for OpaqueAdvertisement
impl Send for OpaqueAdvertisement
impl Sync for OpaqueAdvertisement
impl Unpin for OpaqueAdvertisement
impl UnsafeUnpin for OpaqueAdvertisement
impl UnwindSafe for OpaqueAdvertisement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§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