bridges config: Provide uninhabited placeholder

This will avoid having to make bridge-related trait features in
GuardMgr conditional, which would be non-additive.
This commit is contained in:
Ian Jackson 2022-11-03 15:26:17 +00:00
parent 3dde9f8a05
commit 5bc3934fb4
1 changed files with 14 additions and 0 deletions

View File

@ -79,6 +79,20 @@ mod sample;
mod skew;
mod util;
#[cfg(not(feature = "bridge-client"))]
/// Bridges (stub module, bridges disabled in cargo features)
pub mod bridge {
/// Configuration for a bridge - uninhabited placeholder type
///
/// This type appears in configuration APIs as a stand-in,
/// when the `bridge-client` cargo feature is not enabled.
///
/// The type is uninhabited: without this feature, you cannot create a `BridgeConfig`.
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
#[non_exhaustive]
pub enum BridgeConfig {}
}
#[cfg(feature = "testing")]
pub use config::testing::TestConfig;