6 releases

0.2.0-alpha.2 May 22, 2024
0.2.0-alpha.1 Jan 3, 2024
0.1.3 Jun 13, 2023
0.1.1 Feb 23, 2023
0.1.0 Jan 18, 2023

#433 in Database interfaces

Download history 252/week @ 2024-03-13 265/week @ 2024-03-20 98/week @ 2024-03-27 151/week @ 2024-04-03 232/week @ 2024-04-10 183/week @ 2024-04-17 315/week @ 2024-04-24 192/week @ 2024-05-01 127/week @ 2024-05-08 181/week @ 2024-05-15 438/week @ 2024-05-22 279/week @ 2024-05-29 427/week @ 2024-06-05 313/week @ 2024-06-12 251/week @ 2024-06-19 514/week @ 2024-06-26

1,546 downloads per month
Used in 22 crates (6 directly)

MIT/Apache

225KB
5.5K SLoC

oxsdatatypes

Latest Version Released API docs Crates.io downloads actions status Gitter

oxsdatatypes is an implementation of some XML Schema Definition Language Datatypes. Its main aim is to ease the implementation of SPARQL and XPath.

Usage example:

use std::str::FromStr;
use oxsdatatypes::Decimal;

assert!(Decimal::from_str("22.2").unwrap() > Decimal::from_str("21").unwrap());

Each datatype is represented by a Rust struct.

Each datatype provides:

  • FromStr implementation to parse a datatype string serialization following its lexical mapping.
  • Display implementation to serialize a datatype following its canonical mapping.
  • is_identical_with method following its identity relation.
  • PartialEq, and Eq if possible, implementations following its equality relation.
  • PartialOrd, and Ord if possible, implementations following its order relation.
  • From and TryFrom implementations to implement XPath casting.
  • Various methods implementing XPath functions.
  • from_be_bytes and to_be_bytes methods for serialization.

DateTime::now behavior

The DateTime::now() function needs special OS support. Currently:

  • If the custom-now feature is enabled, a function computing now must be set:
    use oxsdatatypes::Duration;
    
    #[no_mangle]
    fn custom_ox_now() -> Duration {
      unimplemented!("now implementation")
    }
    
  • For wasm32-unknown-unknown if the js feature is enabled the Date.now() ECMAScript API is used.
  • For all other targets SystemTime::now() is used.

License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
  • MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.3–0.9MB
~19K SLoC