Expand description
§51Degrees IP-intelligence shared model
The IP-intelligence element data that the on-premise and cloud engines both
build on, following the
ip-intelligence specification.
Keeping these here, rather than in either engine crate, is what makes the two
engines interface-compatible: both populate the same IpIntelligenceDataBase
under the same IP_DATA_KEY, so a consuming application can swap an
on-premise engine for a cloud one (or the reverse) without touching its
result-reading code. This mirrors the device-detection shared model in
fiftyone-device-detection-shared.
§What the crate provides
IpIntelligenceData, the read trait extendingfiftyone_pipeline_engines::AspectDatawith one strongly-typed accessor per documented network and location property. Most properties are plain (a single typed value, for example aStringcountry name, aboolIsVPNflag, anf32latitude or ani32offset); the few weighted properties (the country-code distributions andMcc) return an orderedVec<WeightedValue<String>>. Every accessor wraps its value in anAspectPropertyValueso an absent value carries the engine’s no-value reason.IpIntelligenceDataBase, the concrete backing both engines populate. It embeds anAspectDataBaseand keeps the typed values in dedicated stores beside it.IP_DATA_KEY, theTypedKeyused to store and retrieve the data, with the data key string"ip".GENERATED_PROPERTY_TYPES(and thegenerated_property_namesanddefault_property_metadata/default_aspect_property_metadatahelpers derived from it) a minimal wrapper can publish.
The IpIntelligenceData trait and its accessor set are generated from the
common metadata by the 51Degrees PropertyGenerator tool into an internal
ip_intelligence_data module; the hand-written data module supplies the
backing store the accessors delegate to. Both are re-exported here, so the
crate root is the single import surface.
Structs§
- IpIntelligence
Data Base - The concrete IP-intelligence element data both engines produce.
Enums§
- Value
Store - A single plain value for one property, or a no-value with the reason.
- Weighted
Store - A weighted value store for a single weighted property.
Constants§
- GENERATED_
PROPERTY_ TYPES - Every generated property paired with its core value type, in name order. The data base uses this to publish per-property metadata.
- IP_
DATA_ KEY - The typed handle used to store and retrieve
IpIntelligenceDataBasein afiftyone_pipeline_core::FlowData. - IP_
DATA_ KEY_ NAME - The string element-data key under which IP-intelligence data is stored in a flow data.
- WEIGHTED_
PROPERTY_ VALUE_ TYPE - The value type a weighted property is reported as in metadata.
- WEIGHTED_
RECORD_ VALUE_ KEY - The key under which each flattened weighted record stores its candidate value in the dynamic property bag mirror.
- WEIGHTED_
RECORD_ WEIGHT_ KEY - The key under which each flattened weighted record stores its
0.0..=1.0weighting multiplier in the dynamic property bag mirror.
Traits§
- IpIntelligence
Data - Strongly-typed read accessors for IP Intelligence properties.
Functions§
- declared_
property_ value_ type - The declared core value type for a property, looked up in the generated table case-insensitively.
- default_
aspect_ property_ metadata - Build the aspect
AspectPropertyMetaDatafor every generated property, wrappingdefault_property_metadatawith empty descriptions and tiers. - default_
property_ metadata - Build the core
PropertyMetaDatafor every generated property, owned by theIP_DATA_KEY_NAMEelement. - generated_
property_ names - Every property name the generated model surfaces, in name order.
