Skip to content

Commit cb9a95e

Browse files
committed
graph_tools wip
1 parent 5e94a93 commit cb9a95e

34 files changed

+294
-30
lines changed

module/move/graphs_tools/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.3.0"
44
edition = "2021"
55
authors = [
66
"Kostiantyn Wandalen <[email protected]>",
7-
"Dmytro Kryvoruchko <[email protected]>",
87
]
98
license = "MIT"
109
readme = "Readme.md"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
/// Define a private namespace for all its items.
3+
mod private
4+
{
5+
6+
use std::
7+
{
8+
hash::Hash,
9+
fmt,
10+
};
11+
12+
///
13+
/// Interface to identify an instance of somthing, for exampel a node.
14+
///
15+
16+
pub trait IdentityInterface
17+
where
18+
Self :
19+
'static +
20+
Copy +
21+
Hash +
22+
fmt::Debug +
23+
PartialEq +
24+
Eq
25+
,
26+
{
27+
}
28+
29+
impl< T > IdentityInterface for T
30+
where
31+
T :
32+
'static +
33+
Copy +
34+
Hash +
35+
fmt::Debug +
36+
PartialEq +
37+
Eq
38+
,
39+
{
40+
}
41+
42+
/// Uniquely identify the node.
43+
pub trait NodeId : IdentityInterface
44+
{
45+
}
46+
47+
}
48+
49+
crate::mod_interface!
50+
{
51+
own use { IdentityInterface, NodeId };
52+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
/// Define a private namespace for all its items.
3+
mod private
4+
{
5+
}
6+
7+
crate::mod_interface!
8+
{
9+
}

module/move/graphs_tools/src/lib.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22
#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/graph_logo_v1_trans.png" ) ]
33
#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/graph_logo_v1_trans.ico" ) ]
44
#![ doc( html_root_url = "https://docs.rs/graphs_tools/latest/graphs_tools/" ) ]
5-
// #![ deny( rust_2018_idioms ) ]
6-
// #![ deny( missing_debug_implementations ) ]
7-
// #![ deny( missing_docs ) ]
85
#![ deny( unused_imports ) ]
96

10-
// #![ feature( type_name_of_val ) ]
11-
// #![ feature( type_alias_impl_trait ) ]
12-
// #![ feature( trace_macros ) ]
13-
147
//!
158
//! Implementation of automata.
169
//!
@@ -19,24 +12,32 @@
1912

2013
#![ allow( unused_imports ) ]
2114
use iter_tools::iter;
22-
use data_type::dt;
15+
// use data_type::dt;
2316
use meta_tools::meta;
2417
use strs_tools::string;
25-
2618
use meta_tools::mod_interface;
19+
20+
/// Define a private namespace for all its items.
21+
mod private
22+
{
23+
}
24+
2725
mod_interface!
2826
{
27+
2928
/// Abstract layer.
3029
#[ cfg( not( feature = "no_std" ) ) ]
3130
layer abs;
31+
3232
/// Canonical representation.
3333
#[ cfg( not( feature = "no_std" ) ) ]
3434
layer canonical;
35-
/// Algorithms.
36-
#[ cfg( not( feature = "no_std" ) ) ]
37-
layer algo;
3835

39-
own use ::meta_tools::prelude::*;
36+
// /// Algorithms.
37+
// #[ cfg( not( feature = "no_std" ) ) ]
38+
// layer algo;
39+
40+
// own use ::meta_tools::prelude::*;
4041
}
4142

4243
// zzz : implement checks

module/move/graphs_tools/tests/inc/basic_test.rs

Whitespace-only changes.
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
#![ allow( unused_imports ) ]
22

33
use super::*;
4-
use std::collections::HashSet;
4+
// use std::collections::HashSet;
55
// use wtools::prelude::*;
66

7-
#[ cfg( not( feature = "no_std" ) ) ]
8-
mod canonical_node_test;
9-
#[ cfg( not( feature = "no_std" ) ) ]
10-
// mod cell_factory_test;
11-
// #[ cfg( not( feature = "no_std" ) ) ]
12-
mod factory_test;
13-
#[ cfg( not( feature = "no_std" ) ) ]
14-
mod identity_test;
15-
mod factory_impls;
7+
mod basic_test;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[package]
2+
name = "graphs_tools_deprecated"
3+
version = "0.3.0"
4+
edition = "2021"
5+
authors = [
6+
"Kostiantyn Wandalen <[email protected]>",
7+
"Dmytro Kryvoruchko <[email protected]>",
8+
]
9+
license = "MIT"
10+
readme = "Readme.md"
11+
documentation = "https://docs.rs/graphs_tools"
12+
repository = "https://github.com/Wandalen/wTools/tree/master/module/core/graphs_tools"
13+
homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/graphs_tools"
14+
description = """
15+
Graphs tools.
16+
"""
17+
categories = [ "algorithms", "development-tools" ]
18+
keywords = [ "fundamental", "general-purpose" ]
19+
20+
[lints]
21+
workspace = true
22+
23+
[package.metadata.docs.rs]
24+
features = [ "full" ]
25+
all-features = false
26+
27+
28+
[features]
29+
default = [
30+
"enabled"
31+
]
32+
full = [
33+
"enabled",
34+
]
35+
no_std = []
36+
use_alloc = [ "no_std" ]
37+
enabled = [ "meta_tools/enabled", "iter_tools/enabled", "data_type/enabled", "strs_tools/enabled" ]
38+
39+
[dependencies]
40+
indexmap = "~1.8"
41+
meta_tools = { workspace = true, features = [ "default" ] }
42+
iter_tools = { workspace = true, features = [ "default" ] }
43+
data_type = { workspace = true, features = [ "default" ] }
44+
strs_tools = { workspace = true, features = [ "default" ] }
45+
derive_tools = { workspace = true, features = [ "default" ] }
46+
# type_constructor ={ workspace = true, features = [ "default" ] }
47+
48+
[dev-dependencies]
49+
test_tools = { workspace = true }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright Kostiantyn Mysnyk and Out of the Box Systems (c) 2021-2024
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!-- {{# generate.module_header{} #}} -->
2+
3+
# Module :: graphs_tools
4+
<!--{ generate.module_header.start() }-->
5+
[![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_graphs_tools_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_graphs_tools_push.yml) [![docs.rs](https://img.shields.io/docsrs/graphs_tools?color=e3e8f0&logo=docs.rs)](https://docs.rs/graphs_tools) [![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fmove%2Fgraphs_tools%2Fexamples%2Fgraphs_tools_trivial.rs,RUN_POSTFIX=--example%20graphs_tools_trivial/https://github.com/Wandalen/wTools) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
6+
<!--{ generate.module_header.end }-->
7+
8+
**NOT ready for production**
9+
10+
<!--
11+
### Basic use-case
12+
13+
```rust
14+
#[ cfg( all( feature = "cell_factory", feature = "use_std" ) ) ]
15+
{
16+
use graphs_tools::prelude::*;
17+
use wtools::prelude::*;
18+
let node : graphs_tools::canonical::Node = from!( 13 );
19+
assert_eq!( node.id(), 13.into() );
20+
println!( "{:?}", node );
21+
/* print : node::13 */
22+
}
23+
```
24+
25+
### To add to your project
26+
27+
```bash
28+
cargo add graphs_tools
29+
```
30+
31+
### Try out from the repository
32+
33+
``` shell test
34+
git clone https://github.com/Wandalen/wTools
35+
cd wTools
36+
cd examples/graphs_tools_trivial
37+
cargo run
38+
```
39+
-->
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! qqq : write proper description
2+
fn main()
3+
{
4+
// xxx : fix me
5+
// use graphs_tools::prelude::*;
6+
// let node : graphs_tools::canonical::Node = from!( 13 );
7+
// assert_eq!( node.id(), 13.into() );
8+
// println!( "{:?}", node );
9+
/* print : node::13 */
10+
}
11+

0 commit comments

Comments
 (0)