Skip to content

Commit

Permalink
Add code example.
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradHoeffner committed Feb 22, 2023
1 parent 0072b8b commit 4533723
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ impl Hdt {
/// FourSectionDictionary with DictionarySectionPlainFrontCoding and SPO order is the only supported implementation.
/// The format is specified at <https://www.rdfhdt.org/hdt-binary-format/>, however there are some deviations.
/// The initial HDT specification at <http://www.w3.org/Submission/2011/03/> is outdated and not supported.
/// # Example
/// ```
/// let file = std::fs::File::open("tests/resources/snikmeta.hdt").expect("error opening file");
/// let hdt = hdt::Hdt::new(std::io::BufReader::new(file)).unwrap();
/// ```
pub fn new<R: std::io::BufRead>(mut reader: R) -> io::Result<Self> {
ControlInfo::read(&mut reader)?;
Header::read(&mut reader)?;
Expand Down

0 comments on commit 4533723

Please sign in to comment.