Crates.io | sqlstate-inline |
lib.rs | sqlstate-inline |
version | 0.1.2 |
source | src |
created_at | 2022-12-09 02:16:04.118661 |
updated_at | 2022-12-09 02:52:03.139781 |
description | Memory efficient const-friendly types for SQLSTATE codes |
homepage | |
repository | https://gitlab.com/cg909/rust-sqlstate-inline |
max_upload_size | |
id | 732939 |
size | 96,409 |
[dependencies]
sqlstate-inline = "0.1"
SQLSTATE codes are 5 character ASCII strings that only use the characters A-Z
and 0-9
.
This crate provides an SqlState
type that is const constructible and only consumes 5 bytes of
memory, providing niches, so that e.g. Option<SqlState>
is also 5 bytes large. This type
dereferences to str
and can be converted to e.g. [u8; 5]
for maximum flexibility. E.g. using a
std::string::String
instead allocates 5 bytes on the heap and use 24 bytes on the stack
(on 64-bit architectures) which in comparison is quite wasteful.
std
: disable this feature to use the crate in no_std
environments.serde
: enable this feature to get serde
(de-)serialization support for
the provided data types.The minimum supported Rust toolchain version is Rust 1.60.0.
Currently tested up to version 1.66.0-nightly.
This crate follows semantic versioning.
Licensed under Mozilla Public License, Version 2.0 (LICENSE or https://www.mozilla.org/en-US/MPL/2.0/).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above including compatibility with secondary licenses, as defined by the MPL.