new-idea
Avril 4 years ago
parent 572bb748a3
commit 7b71b4fdcb
Signed by: flanchan
GPG Key ID: 284488987C31F630

4
Cargo.lock generated

@ -204,9 +204,9 @@ dependencies = [
[[package]]
name = "cryptohelpers"
version = "1.7.1"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "705d37f9525e6e677af724ec414c7cb712e8576dbdd11bafbcfbcea2f468bcd9"
checksum = "33c34ac8437a348d0c23e71327d6d8affe4509cc91e33dd22c1e38f7c9da8070"
dependencies = [
"crc",
"futures",

@ -13,7 +13,7 @@ nightly = ["smallvec/const_generics"]
[dependencies]
cfg-if = "1.0.0"
color-eyre = {version = "0.5.10", default-features=false}
cryptohelpers = {version = "1.7.1", features=["full"]}
cryptohelpers = {version = "1.7.2", features=["full"]}
difference = "2.0.0"
futures = "0.3.8"
generational-arena = "0.2.8"

@ -14,7 +14,11 @@ pub trait FormatSpec
/// A strongly validated string slice
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct FormattedStr<F: FormatSpec + ?Sized>(PhantomData<F>, str);
pub struct FormattedStr<F: FormatSpec + ?Sized>(PhantomData<*const F>, str);
impl<F: FormatSpec + ?Sized> std::marker::Unpin for FormattedStr<F>{}
unsafe impl<F: FormatSpec + ?Sized> std::marker::Send for FormattedStr<F>{}
unsafe impl<F: FormatSpec + ?Sized> std::marker::Sync for FormattedStr<F>{}
/// A strongly validated string
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -136,7 +140,7 @@ pub mod formats
{
use super::*;
/// A hex string format specifier
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum HexFormat{}
impl HexFormat
@ -174,7 +178,7 @@ pub mod formats
/// A PEM formatted string.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum PEMFormat{}
#[derive(Debug)]

@ -1,7 +1,17 @@
use super::*;
use cryptohelpers::sha256::Sha256Hash;
#[derive(Debug)]
id_type!(PostID; "A unique post ID");
/// A single completed post
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Post
{
id: PostID,
name: Option<String>,
email: Option<String>,
body: hard_format::formats::PEMFormattedString,
signature: Option<hard_format::formats::PEMFormattedString>,
hash: Sha256Hash,
}

Loading…
Cancel
Save