#[non_exhaustive]#[repr(u16)]pub enum Domain {
Show 21 variants
General = 0,
GraphAnalytics = 1,
StatisticalML = 2,
Compliance = 3,
RiskManagement = 4,
OrderMatching = 5,
MarketData = 6,
Settlement = 7,
Accounting = 8,
NetworkAnalysis = 9,
FraudDetection = 10,
TimeSeries = 11,
Simulation = 12,
Banking = 13,
BehavioralAnalytics = 14,
ProcessIntelligence = 15,
Clearing = 16,
TreasuryManagement = 17,
PaymentProcessing = 18,
FinancialAudit = 19,
Custom = 100,
}Expand description
Business domain classification for kernel messages.
Each domain has an assigned type ID range to prevent collisions:
- General: 0-99
- GraphAnalytics: 100-199
- StatisticalML: 200-299
- Compliance: 300-399
- RiskManagement: 400-499
- OrderMatching: 500-599
- MarketData: 600-699
- Settlement: 700-799
- Accounting: 800-899
- NetworkAnalysis: 900-999
- FraudDetection: 1000-1099
- TimeSeries: 1100-1199
- Simulation: 1200-1299
- Banking: 1300-1399
- BehavioralAnalytics: 1400-1499
- ProcessIntelligence: 1500-1599
- Clearing: 1600-1699
- TreasuryManagement: 1700-1799
- PaymentProcessing: 1800-1899
- FinancialAudit: 1900-1999
- Custom: 10000+
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
General = 0
General-purpose messages (type IDs: 0-99).
GraphAnalytics = 1
Graph analytics messages (type IDs: 100-199). Includes: PageRank, community detection, centrality measures.
StatisticalML = 2
Statistical/ML messages (type IDs: 200-299). Includes: regression, clustering, classification.
Compliance = 3
Compliance/regulatory messages (type IDs: 300-399). Includes: AML checks, KYC validation, regulatory reporting.
RiskManagement = 4
Risk management messages (type IDs: 400-499). Includes: VaR calculation, stress testing, exposure analysis.
OrderMatching = 5
Order matching messages (type IDs: 500-599). Includes: order submission, matching, cancellation.
MarketData = 6
Market data messages (type IDs: 600-699). Includes: quotes, trades, order book updates.
Settlement = 7
Settlement messages (type IDs: 700-799). Includes: trade settlement, netting, reconciliation.
Accounting = 8
Accounting messages (type IDs: 800-899). Includes: journal entries, ledger updates, trial balance.
NetworkAnalysis = 9
Network analysis messages (type IDs: 900-999). Includes: transaction flow, counterparty analysis.
FraudDetection = 10
Fraud detection messages (type IDs: 1000-1099). Includes: anomaly detection, pattern matching.
TimeSeries = 11
Time series messages (type IDs: 1100-1199). Includes: forecasting, trend analysis, seasonality.
Simulation = 12
Simulation messages (type IDs: 1200-1299). Includes: Monte Carlo, scenario analysis, stress testing.
Banking = 13
Banking messages (type IDs: 1300-1399). Includes: account management, transfers, statements.
BehavioralAnalytics = 14
Behavioral analytics messages (type IDs: 1400-1499). Includes: user behavior, clickstream, session analysis.
ProcessIntelligence = 15
Process intelligence messages (type IDs: 1500-1599). Includes: process mining, DFG, conformance checking.
Clearing = 16
Clearing messages (type IDs: 1600-1699). Includes: CCP clearing, margin calculation, position netting.
TreasuryManagement = 17
Treasury management messages (type IDs: 1700-1799). Includes: cash management, liquidity, FX hedging.
PaymentProcessing = 18
Payment processing messages (type IDs: 1800-1899). Includes: payment initiation, routing, confirmation.
FinancialAudit = 19
Financial audit messages (type IDs: 1900-1999). Includes: audit trails, evidence gathering, compliance verification.
Custom = 100
Custom domain (type IDs: 10000+). For application-specific domains not covered by predefined ones.
Implementations§
Source§impl Domain
impl Domain
Sourcepub const RANGE_SIZE: u64 = 100
pub const RANGE_SIZE: u64 = 100
Number of type IDs reserved per domain (except Custom).
Sourcepub const CUSTOM_BASE: u64 = 10000
pub const CUSTOM_BASE: u64 = 10000
Base type ID for custom domains.
Sourcepub const fn base_type_id(&self) -> u64
pub const fn base_type_id(&self) -> u64
Get the base type ID for this domain.
Type IDs for messages in this domain should be: base_type_id() + offset
where offset is 0-99.
§Example
use ringkernel_core::domain::Domain;
assert_eq!(Domain::General.base_type_id(), 0);
assert_eq!(Domain::OrderMatching.base_type_id(), 500);
assert_eq!(Domain::Custom.base_type_id(), 10000);Sourcepub const fn max_type_id(&self) -> u64
pub const fn max_type_id(&self) -> u64
Get the maximum type ID for this domain.
§Example
use ringkernel_core::domain::Domain;
assert_eq!(Domain::General.max_type_id(), 99);
assert_eq!(Domain::OrderMatching.max_type_id(), 599);Sourcepub const fn contains_type_id(&self, type_id: u64) -> bool
pub const fn contains_type_id(&self, type_id: u64) -> bool
Check if a type ID is within this domain’s range.
§Example
use ringkernel_core::domain::Domain;
assert!(Domain::OrderMatching.contains_type_id(500));
assert!(Domain::OrderMatching.contains_type_id(599));
assert!(!Domain::OrderMatching.contains_type_id(600));Sourcepub const fn from_type_id(type_id: u64) -> Option<Domain>
pub const fn from_type_id(type_id: u64) -> Option<Domain>
Determine which domain a type ID belongs to.
Returns None if the type ID doesn’t match any standard domain.
§Example
use ringkernel_core::domain::Domain;
assert_eq!(Domain::from_type_id(501), Some(Domain::OrderMatching));
assert_eq!(Domain::from_type_id(10500), Some(Domain::Custom));Sourcepub fn from_str(s: &str) -> Option<Domain>
pub fn from_str(s: &str) -> Option<Domain>
Parse domain from string (case-insensitive).
Supports various naming conventions:
- PascalCase: “OrderMatching”
- snake_case: “order_matching”
- lowercase: “ordermatching”
- Short forms: “risk”, “ml”, “sim”
§Example
use ringkernel_core::domain::Domain;
assert_eq!(Domain::from_str("OrderMatching"), Some(Domain::OrderMatching));
assert_eq!(Domain::from_str("order_matching"), Some(Domain::OrderMatching));
assert_eq!(Domain::from_str("risk"), Some(Domain::RiskManagement));
assert_eq!(Domain::from_str("unknown"), None);Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Get the domain name as a static string.
Returns the PascalCase canonical name.
Sourcepub const fn all_standard() -> &'static [Domain]
pub const fn all_standard() -> &'static [Domain]
Get all standard domains (excluding Custom).
Trait Implementations§
impl Copy for Domain
impl Eq for Domain
impl StructuralPartialEq for Domain
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnwindSafe for Domain
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more