mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-08 14:11:56 -07:00
vec: readme: removed example
This commit is contained in:
@@ -10,32 +10,6 @@ A very small, fast, efficient and simple storable `vec` which uses `mmap2` for s
|
||||
- [ ] Insert
|
||||
- [ ] Remove
|
||||
|
||||
## Example
|
||||
|
||||
```rust
|
||||
use std::path::Path;
|
||||
|
||||
use brk_vec::{AnyStorableVec, StorableVec};
|
||||
|
||||
fn main() -> color_eyre::Result<()> {
|
||||
color_eyre::install()?;
|
||||
|
||||
{
|
||||
let mut vec: StorableVec<usize, u32> = StorableVec::import(Path::new("./v"))?;
|
||||
vec.push(21);
|
||||
dbg!(vec.get(0)?); // 21
|
||||
vec.flush()?;
|
||||
}
|
||||
|
||||
{
|
||||
let vec: StorableVec<usize, u32> = StorableVec::import(Path::new("./v"))?;
|
||||
dbg!(vec.get(0)?); // 21
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## Disclaimer
|
||||
|
||||
Portability will depend on the type of values.
|
||||
|
||||
Reference in New Issue
Block a user