Blyx Nest Blyx language
Registry / Library
library · v0.1.0

RecordSpan

Locate the nonempty length-prefixed record containing a byte offset.

Source repository · Package JSON

Use RecordSpan

use vendor::recordspan::recordspan;

Run the example

nest demo recordspan@0.1.0
blyxc native-run recordspan-demo/main.blyx
Example source and expected output
use vendor::recordspan::recordspan;

fn main() {
    let lengths = [0, 3, 2];
    let offset = 3.0;
    let result = recordspan_locate(lengths, offset);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

2
0
2

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIPc6749ae5247f33e98bb64ea6c3b1037b02d260eb7948ff1c6f72c9efb4223c6e3c5e249bb6