Struct instance_chart::Notify
source · [−]Expand description
Wait for notifications of new discoveries, buffering up to 16 discoveries, created using
Chart::notify()
.
Implementations
sourceimpl<T: Debug + Clone> Notify<1, T>
impl<T: Debug + Clone> Notify<1, T>
sourcepub async fn recv_one(&mut self) -> Result<(u64, IpAddr, T), RecvError>
pub async fn recv_one(&mut self) -> Result<(u64, IpAddr, T), RecvError>
await the next discovered instance. Returns the id and custom messag for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::custom_msg()
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
sourceimpl<const N: usize, T: Debug + Clone> Notify<N, T>
impl<const N: usize, T: Debug + Clone> Notify<N, T>
sourcepub async fn recv(&mut self) -> Result<(u64, IpAddr, [T; N]), RecvError>
pub async fn recv(&mut self) -> Result<(u64, IpAddr, [T; N]), RecvError>
await the next discovered instance. Returns the id and custom messages for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::custom_msg()
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
sourcepub async fn recv_nth<const IDX: usize>(
&mut self
) -> Result<(u64, IpAddr, T), RecvError>
pub async fn recv_nth<const IDX: usize>(
&mut self
) -> Result<(u64, IpAddr, T), RecvError>
await the next discovered instance. Returns the id and nth custom messages for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::custom_msg()
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
sourceimpl Notify<1, u16>
impl Notify<1, u16>
sourcepub async fn recv_addr(&mut self) -> Result<(u64, SocketAddr), RecvError>
pub async fn recv_addr(&mut self) -> Result<(u64, SocketAddr), RecvError>
await the next discovered instance. Returns the id and service adresses for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::finish()
that had as single service port set.
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
sourceimpl<const N: usize> Notify<N, u16>
impl<const N: usize> Notify<N, u16>
sourcepub async fn recv_addresses(
&mut self
) -> Result<(u64, [SocketAddr; N]), RecvError>
pub async fn recv_addresses(
&mut self
) -> Result<(u64, [SocketAddr; N]), RecvError>
await the next discovered instance. Buffers up to 16 discoveries. Returns the id and service adresseses for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::finish()
that had multiple service ports set.
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
sourcepub async fn recv_nth_addr<const IDX: usize>(
&mut self
) -> Result<(u64, SocketAddr), RecvError>
pub async fn recv_nth_addr<const IDX: usize>(
&mut self
) -> Result<(u64, SocketAddr), RecvError>
await the next discovered instance. Buffers up to 16 discoveries. Returns the id and nth service adresses for new node when it is discovered.
Note
Can only be called on a
Notify for a chart created with ChartBuilder::finish()
that had multiple service ports set.
Errors
If more the 16 discoveries have been made since this was called this returns
RecvError::Lagged
Trait Implementations
Auto Trait Implementations
impl<const N: usize, T> !RefUnwindSafe for Notify<N, T>
impl<const N: usize, T> Send for Notify<N, T> where
T: Send,
impl<const N: usize, T> Sync for Notify<N, T> where
T: Send,
impl<const N: usize, T> Unpin for Notify<N, T>
impl<const N: usize, T> !UnwindSafe for Notify<N, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more