pub struct BeaconAddressLookup { /* private fields */ }Expand description
An AddressLookup that publishes and resolves addresses over a UDP beacon.
The _handle field is never read; it exists only so that dropping the lookup
aborts the background actor.
Implementations§
Source§impl BeaconAddressLookup
impl BeaconAddressLookup
Sourcepub fn new(
endpoint_id: PublicKey,
scope: Option<[u8; 16]>,
base_port: u16,
interval: Duration,
interface: Option<&str>,
) -> Result<Self>
pub fn new( endpoint_id: PublicKey, scope: Option<[u8; 16]>, base_port: u16, interval: Duration, interface: Option<&str>, ) -> Result<Self>
Creates a beacon address lookup and starts its background task.
The receiver socket is bound to the effective port on all interfaces
(or on the configured interface when one is given) and the sender
broadcasts to 255.255.255.255 plus the directed broadcast of every
up, non-loopback IPv4 interface (or only the configured one).
§Errors
Returns an error if the receiver or sender socket cannot be created.
Trait Implementations§
Source§impl AddressLookup for BeaconAddressLookup
impl AddressLookup for BeaconAddressLookup
Source§fn resolve(
&self,
endpoint_id: PublicKey,
) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
fn resolve( &self, endpoint_id: PublicKey, ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
Publishes the given
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for BeaconAddressLookup
impl Clone for BeaconAddressLookup
Source§fn clone(&self) -> BeaconAddressLookup
fn clone(&self) -> BeaconAddressLookup
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BeaconAddressLookup
impl RefUnwindSafe for BeaconAddressLookup
impl Send for BeaconAddressLookup
impl Sync for BeaconAddressLookup
impl Unpin for BeaconAddressLookup
impl UnsafeUnpin for BeaconAddressLookup
impl UnwindSafe for BeaconAddressLookup
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( self, _endpoint: &Endpoint, ) -> Result<impl AddressLookup, AddressLookupBuilderError>
Turns this builder into a ready-to-use
AddressLookup. Read moreSource§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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