1 unstable release

0.1.0 Jun 5, 2023

#1930 in Parser implementations

GPL-3.0-only

16KB
216 lines

Tinylog

About

The tinylog format is a minimal microblog format for the small web (Gemini, Spartan etc). This library implements a set of types useful for working with Tinylogs which can be readily converted to and from strings. This would be useful for automating adding entries or possibly in an aggregator type application.

Usage

Parsing a Tinylog from a String

// Assume some type `T` which implements the `Time` trait
use tinylog::Tinylog;

const TL: &'static str = include_str!("../test/tinylog.gmi");
let log = TL.parse::<T>().unwrap();
assert_eq!(log.entries.len(), 2);

lib.rs:

About

The tinylog format is a minimal microblog format for the small web (Gemini, Spartan etc). This library implements a set of types useful for working with Tinylogs which can be readily converted to and from strings. This would be useful for automating adding entries or possibly in an aggregator type application.

Usage

Parsing a Tinylog from a String and back again

#
use tinylog_gmi::Tinylog;

const TL: &'static str = include_str!("../test/tinylog.gmi");
let log = TL.parse::<Tinylog<NaiveTime>>().unwrap();
assert_eq!(log.entries.len(), 2);
assert_eq!(log.to_string(), TL);

No runtime deps