pub struct MulticastProvider { /* private fields */ }Expand description
The multicast provider: the declared group and port, the socket its threads share, and the counters its status reports. Constructed by the manager from the declaration.
Implementations§
Source§impl MulticastProvider
impl MulticastProvider
Sourcepub fn new(config: MulticastConfig) -> Self
pub fn new(config: MulticastConfig) -> Self
A provider over its declaration; nothing opens until the manager calls start,
so constructing one is free and never touches the network.
Sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
The port the provider listens and announces on: the declared port, or — when the
declaration says 0 — the free one the system chose at the bind, so nothing races
between finding a port and taking it. 0 before the provider has started.
use majordomus_cli::mesh::config::MulticastConfig;
use majordomus_cli::mesh::multicast::MulticastProvider;
let provider = MulticastProvider::new(MulticastConfig {
port: 0,
..MulticastConfig::default()
});
assert_eq!(provider.port(), 0, "nothing is bound before the provider starts");Trait Implementations§
Source§impl MeshProvider for MulticastProvider
impl MeshProvider for MulticastProvider
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
The provider id, stable, snake_case: the word status listings and sighting
provenance carry for this mechanism.
Source§fn start(&mut self, ctx: &ProviderContext) -> Result<(), MeshError>
fn start(&mut self, ctx: &ProviderContext) -> Result<(), MeshError>
Start the provider’s threads. An
Err marks this provider Failed and starts
the others regardless.Source§fn status(&self) -> ProviderStatus
fn status(&self) -> ProviderStatus
The current status: state, the reason or subject, and this provider’s counters.
Auto Trait Implementations§
impl !Freeze for MulticastProvider
impl RefUnwindSafe for MulticastProvider
impl Send for MulticastProvider
impl Sync for MulticastProvider
impl Unpin for MulticastProvider
impl UnsafeUnpin for MulticastProvider
impl UnwindSafe for MulticastProvider
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