RinhaDeBackend::ParsedRequest
Stack-allocated, zero-heap projection of FraudScoreRequest. The parser writes primitives (Float64/Int32/Int64/Bool) directly into instances of this struct; merchant_id and customer.known_merchants are kept as (offset, length) byte ranges into the original request buffer so we can match them later without allocating String copies.
Sized to fit comfortably on a fiber stack: roughly 200 bytes.
Constants
Maximum number of known_merchants we track. The Rinha fixtures top out at 5; we leave headroom and silently drop extras (the matcher just returns "unknown" if merchant.id was past this cap, which is fine because falling back to "unknown" never fails harder than getting it right would have).
Constructors
Instance methods
MCC packed as 4 ASCII bytes (b0<<24 | b1<<16 | b2<<8 | b3). Lets MccRisk do a Hash(UInt32, Float32) lookup with no String allocation.
MCC packed as 4 ASCII bytes (b0<<24 | b1<<16 | b2<<8 | b3). Lets MccRisk do a Hash(UInt32, Float32) lookup with no String allocation.
requested_at, broken into the pieces the vectorizer needs:
- hour for vec[3]
- day-of-week (Mon=0..Sun=6) for vec[4]
- total seconds since epoch for the minutes_since_last_tx delta
requested_at, broken into the pieces the vectorizer needs:
- hour for vec[3]
- day-of-week (Mon=0..Sun=6) for vec[4]
- total seconds since epoch for the minutes_since_last_tx delta