Skip to content

Commit

Permalink
shortened readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sokorototo committed Feb 10, 2025
1 parent ecc4c94 commit 849dd2b
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,6 @@

### 🀄 Show me some code _dang it!_

##### > Build a basic archive

```rust
use std::{io::Cursor, fs::File};
use vach::prelude::*;

let mut leaves = [
Leaf::new(File::open("background.wav")?, "ambient"),
Leaf::new(vec![12, 23, 34, 45, 56, 67, 78, 89, 10], "ftstep"),
Leaf::new(b"Fast-Acting Long-Lasting, *Bathroom Reader*" as &[u8], "hello")
];

let mut target = File::create("sounds.vach")?;
let bytes_written = dump(&mut target, &mut leaves, &config, None).unwrap();
```

##### > Load resources from a basic archive

```rust
use std::fs::File;
use vach::prelude::*;

// source can be anything that implements io::Read and io::Seek
let source = File::open("sounds.vach")?;
let archive = Archive::new(source)?;

let resource = archive.fetch("ambient")?;
```

##### > A quick consolidated example

```rust
let mut target = Cursor::new(Vec::<u8>::new());

Expand Down

0 comments on commit 849dd2b

Please sign in to comment.