pub struct ServiceLicenceLinks {
pub counters: ServiceLinksCounters,
/* private fields */
}Expand description
The licence exchange’s mesh in service mode.
Fields§
§counters: ServiceLinksCountersCounters.
Implementations§
Source§impl ServiceLicenceLinks
impl ServiceLicenceLinks
Sourcepub fn new(
sender: Arc<dyn PeerSender>,
directory: Arc<dyn PeerDirectory>,
) -> Arc<Self> ⓘ
pub fn new( sender: Arc<dyn PeerSender>, directory: Arc<dyn PeerDirectory>, ) -> Arc<Self> ⓘ
Links that send through sender and read peers from directory.
Sourcepub fn with_reply_caps(
sender: Arc<dyn PeerSender>,
directory: Arc<dyn PeerDirectory>,
total: usize,
per_peer: usize,
) -> Arc<Self> ⓘ
pub fn with_reply_caps( sender: Arc<dyn PeerSender>, directory: Arc<dyn PeerDirectory>, total: usize, per_peer: usize, ) -> Arc<Self> ⓘ
Self::new with explicit reply caps (in flight overall, per peer).
Sourcepub fn holder(&self) -> Option<bool>
pub fn holder(&self) -> Option<bool>
Whether this daemon holds the service’s reserved licence topics, as
of the last refresh (None: unknown, the last refresh failed or the
service did not say).
Sourcepub fn holder_uid(&self) -> Option<u32>
pub fn holder_uid(&self) -> Option<u32>
The uid the service named as the licence holder at the last refresh.
Sourcepub fn subscribe_holder(&self) -> Receiver<Option<bool>>
pub fn subscribe_holder(&self) -> Receiver<Option<bool>>
Changes of Self::holder.
Sourcepub async fn refresh(&self) -> Result<(), String>
pub async fn refresh(&self) -> Result<(), String>
Read the service’s peer view; raise Joined for each peer that became
licensed since the last refresh.
Sourcepub fn spawn_refresh(
self: &Arc<Self>,
every: Duration,
) -> Option<JoinHandle<()>>
pub fn spawn_refresh( self: &Arc<Self>, every: Duration, ) -> Option<JoinHandle<()>>
Self::refresh now and every every while the links are alive.
Sourcepub async fn deliver(&self, from: &PeerCtx, msg: KernelMessage) -> bool
pub async fn deliver(&self, from: &PeerCtx, msg: KernelMessage) -> bool
Take a licence delivery. Returns false when msg is not on a licence
topic (the caller passes it on); true when it was consumed, handled or
not.
Trait Implementations§
Source§impl LicenceLinks for ServiceLicenceLinks
impl LicenceLinks for ServiceLicenceLinks
Source§fn set_control_sink(&self, topic: &str, sink: Arc<dyn PeerControlSink>)
fn set_control_sink(&self, topic: &str, sink: Arc<dyn PeerControlSink>)
Receive
topic with sink (first registration wins).Source§fn peer_ids(&self) -> Vec<String>
fn peer_ids(&self) -> Vec<String>
Peers to ask for a catch-up sync (the answering side checks admission).
Source§fn peer_licensed(&self, peer: &str) -> bool
fn peer_licensed(&self, peer: &str) -> bool
True when
peer may be sent bindings and grants: verified by
admission and of class node.Source§fn route_to_remote<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 str,
msg: KernelMessage,
) -> Pin<Box<dyn Future<Output = KernelResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn route_to_remote<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 str,
msg: KernelMessage,
) -> Pin<Box<dyn Future<Output = KernelResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send
msg to peer.Source§fn subscribe_peer_events(&self) -> Option<Receiver<MeshPeerEvent>>
fn subscribe_peer_events(&self) -> Option<Receiver<MeshPeerEvent>>
Peer-join events, for the sync on connect (
None: this mesh has none
and only the periodic sync runs).Auto Trait Implementations§
impl !Freeze for ServiceLicenceLinks
impl !RefUnwindSafe for ServiceLicenceLinks
impl !UnwindSafe for ServiceLicenceLinks
impl Send for ServiceLicenceLinks
impl Sync for ServiceLicenceLinks
impl Unpin for ServiceLicenceLinks
impl UnsafeUnpin for ServiceLicenceLinks
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
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