mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-02 05:49:06 +02:00
Add documentation comments for all items
This commit is contained in:
parent
ba86dc8c06
commit
05a8056cbf
26 changed files with 576 additions and 42 deletions
|
@ -1,9 +1,12 @@
|
|||
//! Functions for reading and deserializing compressed NBT data
|
||||
|
||||
use std::{fs::File, io::prelude::*, path::Path};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use flate2::read::GzDecoder;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
/// Reads compressed NBT data from a reader and deserializes to a given data structure
|
||||
pub fn from_reader<R, T>(reader: R) -> Result<T>
|
||||
where
|
||||
R: Read,
|
||||
|
@ -18,6 +21,7 @@ where
|
|||
fastnbt::from_bytes(&buf).context("Failed to decode NBT data")
|
||||
}
|
||||
|
||||
/// Reads compressed NBT data from a file and deserializes to a given data structure
|
||||
pub fn from_file<P, T>(path: P) -> Result<T>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue