1use crate::errors::Result;
2
3pub struct Blob {
4 pub contents: Vec<u8>
5}
6
7impl Blob {
8 pub fn load<T: std::io::Read>(handle: &mut T) -> Result<Blob> {
9 let mut contents = Vec::new();
10 handle.read_to_end(&mut contents)?;
11
12 Ok(Blob {
13 contents
14 })
15 }
16}