struct

RinhaDeBackend::ParsedRequest

Inherits Struct < Value < Object

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

MAX_KNOWN_MERCHANTS = 16

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

amount
Source
amount=(amount : Float64)
Source
cust_avg_amount
Source
cust_avg_amount=(cust_avg_amount : Float64)
Source
cust_tx_count_24h
Source
cust_tx_count_24h=(cust_tx_count_24h : Int32)
Source
has_last_tx
Source
has_last_tx=(has_last_tx : Bool)
Source
installments
Source
installments=(installments : Int32)
Source
known_count

Byte ranges of customer.known_merchants entries.

Source
known_count=(known_count : Int32)

Byte ranges of customer.known_merchants entries.

Source
known_lengths
Source
known_lengths=(known_lengths : StaticArray(Int32, 16))
Source
known_offsets
Source
known_offsets=(known_offsets : StaticArray(Int32, 16))
Source
last_km_from_current
Source
last_km_from_current=(last_km_from_current : Float64)
Source
last_sec_total
Source
last_sec_total=(last_sec_total : Int64)
Source
mcc_packed

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.

Source
mcc_packed=(mcc_packed : UInt32)

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.

Source
merchant_avg_amount
Source
merchant_avg_amount=(merchant_avg_amount : Float64)
Source
merchant_id_len
Source
merchant_id_len=(merchant_id_len : Int32)
Source
merchant_id_off

Byte range of merchant.id within the input buffer.

Source
merchant_id_off=(merchant_id_off : Int32)

Byte range of merchant.id within the input buffer.

Source
req_dow_index
Source
req_dow_index=(req_dow_index : Int32)
Source
req_hour

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
Source
req_hour=(req_hour : Int32)

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
Source
req_sec_total
Source
req_sec_total=(req_sec_total : Int64)
Source
term_card_present
Source
term_card_present=(term_card_present : Bool)
Source
term_is_online
Source
term_is_online=(term_is_online : Bool)
Source
term_km_from_home
Source
term_km_from_home=(term_km_from_home : Float64)
Source