#[cfg(feature = "geo")]
use super::GeoContext;
#[cfg(any(feature = "device", feature = "std"))]
use super::DeviceContext;
#[cfg(any(feature = "load", feature = "std"))]
use super::LoadContext;
#[cfg(any(feature = "legal", feature = "std"))]
use super::LegalContext;
#[cfg(feature = "geo")]
pub trait GeoSensor: Send + Sync {
fn sense(&self) -> Option<GeoContext>;
}
#[cfg(feature = "geo")]
pub struct NullGeoSensor;
#[cfg(feature = "geo")]
impl GeoSensor for NullGeoSensor {
fn sense(&self) -> Option<GeoContext> {
None
}
}
#[cfg(any(feature = "device", feature = "std"))]
pub trait DeviceSensor: Send + Sync {
fn sense(&self) -> Option<DeviceContext>;
}
#[cfg(any(feature = "device", feature = "std"))]
pub struct NullDeviceSensor;
#[cfg(any(feature = "device", feature = "std"))]
impl DeviceSensor for NullDeviceSensor {
fn sense(&self) -> Option<DeviceContext> {
None
}
}
#[cfg(any(feature = "load", feature = "std"))]
pub trait LoadSensor: Send + Sync {
fn sense(&self) -> Option<LoadContext>;
}
#[cfg(any(feature = "load", feature = "std"))]
pub struct NullLoadSensor;
#[cfg(any(feature = "load", feature = "std"))]
impl LoadSensor for NullLoadSensor {
fn sense(&self) -> Option<LoadContext> {
None
}
}
#[cfg(any(feature = "legal", feature = "std"))]
pub trait PolicyEngine: Send + Sync {
fn evaluate_for_jurisdiction(&self, jurisdiction: &str) -> Option<LegalContext>;
}
#[cfg(any(feature = "legal", feature = "std"))]
pub struct NullPolicyEngine;
#[cfg(any(feature = "legal", feature = "std"))]
impl PolicyEngine for NullPolicyEngine {
fn evaluate_for_jurisdiction(&self, _jurisdiction: &str) -> Option<LegalContext> {
None
}
}