Crates.io | frame-picker |
lib.rs | frame-picker |
version | 0.1.0 |
source | src |
created_at | 2024-03-06 08:14:35.734255 |
updated_at | 2024-03-06 08:14:35.734255 |
description | FramePicker is a Rust library for handling network frame data, designed to solve problems similar to TCP/UART packet sticking. |
homepage | |
repository | https://github.com/cumthugo/frame-picker.git |
max_upload_size | |
id | 1164468 |
size | 12,076 |
FramePicker
is a Rust library for handling network frame data, designed to solve problems similar to TCP/UART packet sticking.
FramePicker
structure for storing and processing network frame data.FrameMeta
trait for defining the metadata of network frames.First, define a type that implements the FrameMeta
trait. Then, create a FramePicker
instance and use it to process network frame data.
let mut picker = FramePicker::<500, Iap2FrameMeta>::new();
let data = [0xff, 0x5a, 0x00, 0x0a, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a];
picker.feed_data(&data).unwrap();
assert!(picker.contain_frame());
assert!(picker.frame_complete());
Use the cargo test
command to run test cases.
PRs and issues are welcome.