Skip to main content

Domain

Enum Domain 

#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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§

§

impl Domain

pub const RANGE_SIZE: u64 = 100

Number of type IDs reserved per domain (except Custom).

pub const CUSTOM_BASE: u64 = 10000

Base type ID for custom domains.

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);

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);

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));

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));

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);

pub const fn as_str(&self) -> &'static str

Get the domain name as a static string.

Returns the PascalCase canonical name.

pub const fn all_standard() -> &'static [Domain]

Get all standard domains (excluding Custom).

Trait Implementations§

§

impl Clone for Domain

§

fn clone(&self) -> Domain

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Domain

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Domain

§

fn default() -> Domain

Returns the “default value” for a type. Read more
§

impl Display for Domain

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl FromStr for Domain

§

type Err = DomainParseError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Domain, <Domain as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for Domain

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq for Domain

§

fn eq(&self, other: &Domain) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more