MCPcopy Create free account
hub / github.com/dermesser/integer-encoding-rs / read_and_verify_fixedints

Function read_and_verify_fixedints

examples/read_write_file.rs:36–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36async fn read_and_verify_fixedints() -> io::Result<()> {
37 let f = tokio::fs::File::open("/tmp/fixedintbytes").await?;
38 let mut f = tokio::io::BufReader::new(f);
39 let i1: u32 = f.read_fixedint_async().await?;
40 let i2: u32 = f.read_fixedint_async().await?;
41 let i3: u32 = f.read_fixedint_async().await?;
42 let i4: u32 = f.read_fixedint_async().await?;
43 assert!(f.read_fixedint_async::<u32>().await.is_err());
44 println!("{:?}", (i1, i2, i3, i4));
45 assert!(i2 == 2 * i1 && i3 == 3 * i1);
46 Ok(())
47}
48
49#[tokio::main]
50async fn main() {

Callers 1

mainFunction · 0.85

Calls 1

read_fixedint_asyncMethod · 0.80

Tested by

no test coverage detected