Enum netidx::publisher::BindCfg [−][src]
Control how the publisher picks a bind address. The address we give to the resolver server must be uniquely routable back to us, otherwise clients will not be able to subscribe. In the furtherance of this goal there are a number of address rules to follow,
- no unspecified (0.0.0.0)
- no broadcast (255.255.255.255)
- no multicast addresses (224.0.0.0/8)
- no link local addresses (169.254.0.0/16)
- loopback (127.0.0.1, or ::1) is only allowed if all the resolvers are also loopback
- private addresses (192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12) are only allowed if all the resolvers are also using private addresses.
As well as the above rules we will enumerate all the network interface addresses present at startup time and check that the specified bind address (or specification in case of Addr) matches exactly 1 of them.
Variants
Bind to the interface who’s address matches addr
when masked
with netmask
, e.g.
192.168.0.0/16
will match interfaces with addresses 192.168.1.1, 192.168.10.234, … etc,
192.168.0.0/24
will match interfaces with addresses 192.168.0.[1-254]
Examples
use netidx::publisher::BindCfg; "ffff:1c00:2700:3c00::/64".parse::<BindCfg>().unwrap(); "127.0.0.1/32".parse::<BindCfg>().unwrap(); "192.168.2.0/24".parse::<BindCfg>().unwrap();
Exact(SocketAddr)
Bind to the specifed SocketAddr
, error if it is in use. If
you want to OS to pick a port for you, use Exact with port
0. The ip address you specify must obey all the rules, and
must be the ip address of one of the network interfaces
present on the machine at the time of publisher creation.
Examples
use netidx::publisher::BindCfg; "[ffff:1c00:2700:3c00::]:1234".parse::<BindCfg>().unwrap(); "192.168.0.1:1234".parse::<BindCfg>().unwrap();
Trait Implementations
impl Clone for BindCfg
[src]
impl Copy for BindCfg
[src]
impl Debug for BindCfg
[src]
impl Eq for BindCfg
[src]
impl FromStr for BindCfg
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<BindCfg> for BindCfg
[src]
impl StructuralEq for BindCfg
[src]
impl StructuralPartialEq for BindCfg
[src]
Auto Trait Implementations
impl RefUnwindSafe for BindCfg
impl Send for BindCfg
impl Sync for BindCfg
impl Unpin for BindCfg
impl UnwindSafe for BindCfg
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,