Skip to content

Commit 40c4f2e

Browse files
authored
v0.0.3 (#11)
Signed-off-by: FL03 <jo3mccain@icloud.com> --------- Signed-off-by: FL03 <jo3mccain@icloud.com>
1 parent 426d554 commit 40c4f2e

11 files changed

Lines changed: 378 additions & 24 deletions

File tree

Cargo.lock

Lines changed: 292 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ license = "Apache-2.0"
2222
readme = "README.md"
2323
repository = "https://github.com/FL03/rspace.git"
2424
rust-version = "1.85.0"
25-
version = "0.0.2"
25+
version = "0.0.3"
2626

2727
[workspace.dependencies]
28-
rspace = { default-features = false, path = "rspace", version = "0.0.2" }
29-
rspace-core = { default-features = false, path = "core", version = "0.0.2" }
30-
rspace-traits = { default-features = false, path = "traits", version = "0.0.2" }
28+
rspace = { default-features = false, path = "rspace", version = "0.0.3" }
29+
rspace-core = { default-features = false, path = "core", version = "0.0.3" }
30+
rspace-traits = { default-features = false, path = "traits", version = "0.0.3" }
3131

32-
rspace-derive = { default-features = false, path = "derive", version = "0.0.2" }
33-
rspace-macros = { default-features = false, path = "macros", version = "0.0.2" }
32+
rspace-derive = { default-features = false, path = "derive", version = "0.0.3" }
33+
rspace-macros = { default-features = false, path = "macros", version = "0.0.3" }
3434
# development & benchmarking
3535
criterion = { version = "0.8" }
3636
# concurrency & parallelism

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.35.0"
1+
msrv = "1.85.0"

core/Cargo.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ no-dev-version = true
2525
tag-name = "{{version}}"
2626

2727
[lib]
28-
crate-type = ["cdylib", "rlib"]
2928
bench = false
29+
crate-type = ["cdylib", "rlib"]
3030
doctest = true
3131
test = true
3232

@@ -45,7 +45,7 @@ rand = { optional = true, workspace = true }
4545
rand_core = { optional = true, workspace = true }
4646
rand_distr = { optional = true, workspace = true }
4747
# serialization
48-
serde = { optional = true, features = ["derive"], workspace = true }
48+
serde = { optional = true, workspace = true }
4949
serde_derive = { optional = true, workspace = true }
5050
serde_json = { optional = true, workspace = true }
5151
# WebAssembly
@@ -65,12 +65,15 @@ full = [
6565
# ********* [FF] Features *********
6666
json = [
6767
"alloc",
68+
"serde",
6869
"serde_json",
6970
]
7071

7172
macros = []
7273

7374
nightly = [
75+
"hashbrown?/nightly",
76+
"rand?/nightly",
7477
"rspace-traits/nightly",
7578
]
7679

@@ -103,6 +106,8 @@ wasm = [
103106
alloc = [
104107
"rspace-traits/alloc",
105108
"hashbrown?/alloc",
109+
"rand?/alloc",
110+
"rand_distr?/alloc",
106111
"serde?/alloc",
107112
"serde_json?/alloc",
108113
]
@@ -130,14 +135,19 @@ rayon = [
130135

131136
rng = [
132137
"dep:getrandom",
138+
"rand?/small_rng",
133139
]
134140

135141
serde = [
136142
"dep:serde",
137143
"dep:serde_derive",
138-
"rspace-traits/serde",
144+
"serde?/derive",
139145
"hashbrown?/serde",
140146
"num-complex?/serde",
147+
"rand?/serde",
148+
"rand_core?/serde",
149+
"rand_distr?/serde",
150+
"rspace-traits/serde",
141151
]
142152

143153
serde_json = ["dep:serde_json"]

core/src/error.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pub type Result<T> = core::result::Result<T, Error>;
1010
/// The custom error type for the crate.
1111
#[derive(Debug, thiserror::Error)]
1212
pub enum Error {
13+
#[error("The impossible has occurred...")]
14+
Infalliable(core::convert::Infallible),
1315
#[cfg(feature = "alloc")]
1416
#[error(transparent)]
1517
BoxError(#[from] alloc::boxed::Box<dyn core::error::Error + Send + Sync + 'static>),
@@ -27,7 +29,7 @@ pub enum Error {
2729
mod impl_alloc {
2830
use super::Error;
2931
use alloc::boxed::Box;
30-
use alloc::string::String;
32+
use alloc::string::{String, ToString};
3133

3234
impl Error {
3335
pub fn box_error<E>(error: E) -> Self
@@ -36,6 +38,10 @@ mod impl_alloc {
3638
{
3739
Self::BoxError(Box::new(error))
3840
}
41+
42+
pub fn unknown<E: ToString>(error: E) -> Self {
43+
Self::Unknown(error.to_string())
44+
}
3945
}
4046

4147
impl From<&str> for Error {

default.nix

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{ pkgs, nixpkgs, system, makeRustPlatform, rust-overlay }:
2+
let
3+
rustPkgs = import nixpkgs {
4+
inherit system;
5+
overlays = [ (import rust-overlay) ];
6+
};
7+
8+
rustVersion = "1.85.0";
9+
wasmUnknownUknown = "wasm32-unknown-unknown";
10+
wasm32Wasi = "wasm32-wasi";
11+
12+
rustDefaultTarget = rustPkgs.rust-bin.stable.${rustVersion}.default;
13+
14+
rustWithWasmTarget = rustPkgs.rust-bin.nightly.${rustVersion}.default.override {
15+
targets = [ wasmUnknownUknown ];
16+
};
17+
18+
rustPlatform = makeRustPlatform {
19+
cargo = rustDefaultTarget;
20+
rustc = rustDefaultTarget;
21+
};
22+
23+
rustPlatformWasm = makeRustPlatform {
24+
cargo = rustWithWasmTarget;
25+
rustc = rustWithWasmTarget;
26+
};
27+
28+
common = {
29+
version = "0.0.3";
30+
src = self;
31+
32+
cargoLock = {
33+
lockFile = ./Cargo.lock;
34+
};
35+
36+
nativeBuildInputs = [ pkgs.pkg-config ];
37+
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
38+
};
39+
in {
40+
workspace = pkgs.rustPlatformWasm.buildRustPackage (common // {
41+
cargoBuildFlags = "--release --workspace";
42+
});
43+
}

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
in rec {
2020
packages.default = pkgs.rustPlatform.buildRustPackage {
2121
pname = "rspace";
22-
version = "0.0.2";
23-
src = ./.;
22+
version = "0.0.3";
23+
src = self; # ./.;
2424
cargoLock = {
2525
lockFile = ./Cargo.lock;
2626
};

rspace/examples/space.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() -> rspace::Result<()> {
1818

1919
let container = Something([1, 2, 3, 4, 5]);
2020
tracing::info! { ?container }
21-
21+
2222
Ok(())
2323
}
2424

shell.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{ channel ? "stable", profile ? "default" }:
2+
with import <nixpkgs> { overlays = [ (import rust-overlay) ]; };
3+
mkShell {
4+
nativeBuildInputs = [
5+
(if channel == "nightly" then
6+
rust-bin.selectLatestNightlyWith (toolchain: toolchain.${profile})
7+
else
8+
rust-bin.${channel}.latest.${profile})
9+
];
10+
}

traits/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ full = [
5757
"serde",
5858
]
5959

60-
nightly = []
60+
nightly = [
61+
"hashbrown?/nightly",
62+
]
6163

6264
# ************* [FF:Environments] *************
6365
std = [

0 commit comments

Comments
 (0)