#[repr(C)]pub struct HurrayReaderOptions {
pub max_descriptor_bytes: u64,
pub max_buffer_bytes: u64,
pub enforce_cross_machine_sync: bool,
pub max_composite_depth: usize,
}Expand description
Resource limits and transport assumptions for a reader.
Pass null to hurray_reader_new for the defaults. The fields map one-to-one onto
hurray-io’s StreamReaderOptions; a reader over an untrusted socket SHOULD set both
limits, because a descriptor’s declared sizes are attacker-controlled until they are
bounded.
Fields§
§max_descriptor_bytes: u64Maximum byte length of a single descriptor. Default: 16 MiB.
max_buffer_bytes: u64Maximum byte length of a single buffer. Default: unbounded.
enforce_cross_machine_sync: boolReject buffers whose sync mode is not ProducerSynced. Set this when the stream
crosses a machine boundary, where a device-local synchronization handle means
nothing.
max_composite_depth: usizeMaximum composite nesting depth accepted by hurray_reader_next_item.
Default: 64. Pass 0 for that default.
Bounds the assembler, not the byte machine: the core reassembles nothing, so
hurray_reader_next_tensor is unaffected by this field.