Skip to content

Commit af99ca2

Browse files
committed
strs_tools refactoring. unilang
1 parent fe1d1f8 commit af99ca2

File tree

155 files changed

+6682
-3842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+6682
-3842
lines changed

.github/workflows/rust.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Rust CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
build-and-test:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
- name: Build
25+
run: cargo build --verbose
26+
- name: Run tests
27+
run: cargo test --verbose --workspace

module/core/component_model/Readme.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!-- {{# generate.module_header{} #}} -->
22

3-
# Module :: component_model
3+
# Module :: `component_model`
44

55
[![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental)
66
[![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_component_model_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_component_model_push.yml)
77
[![docs.rs](https://img.shields.io/docsrs/component_model?color=e3e8f0&logo=docs.rs)](https://docs.rs/component_model)
8-
[![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%2Fcore%2Fcomponent_model%2Fexamples%2Fcomponent_model_trivial.rs,RUN_POSTFIX=--example%20module%2Fcore%2Fcomponent_model%2Fexamples%2Fcomponent_model_trivial.rs/https://github.com/Wandalen/wTools)
8+
[![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%2Fcore%2Fcomponent_model%2Fexamples%2Fcomponent_model_trivial.rs,RUN_POSTFIX=--example%2Fcore%2Fcomponent_model%2Fexamples%2Fcomponent_model_trivial.rs/https://github.com/Wandalen/wTools)
99
[![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
1010

1111
A flexible component model for Rust supporting generic assignment and type-based field access.
@@ -47,19 +47,17 @@ where
4747
}
4848
}
4949

50-
fn main() {
51-
let mut person = Person::default();
52-
person.assign(42);
53-
person.assign("Alice");
54-
assert_eq!(person, Person { age: 42, name: "Alice".to_string() });
55-
}
50+
let mut person = Person::default();
51+
person.assign(42);
52+
person.assign("Alice");
53+
assert_eq!(person, Person { age: 42, name: "Alice".to_string() });
5654
```
5755

5856
## API Overview
5957

60-
- **Assign**: Generic trait for assigning values to struct fields by type.
61-
- **AssignWithType**: Trait for assigning values with explicit type annotation.
62-
- **ComponentsAssign**: Trait for assigning multiple components at once.
58+
- **`Assign`**: Generic trait for assigning values to struct fields by type.
59+
- **`AssignWithType`**: Trait for assigning values with explicit type annotation.
60+
- **`ComponentsAssign`**: Trait for assigning multiple components at once.
6361

6462
See [component_model_types documentation](https://docs.rs/component_model_types) for details.
6563

module/core/component_model/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub mod dependency
2626
#[ cfg( feature = "enabled" ) ]
2727
pub use own::*;
2828

29-
#[ allow( unused_imports ) ]
3029
#[ cfg( feature = "enabled" ) ]
3130
// Former macro is intentionally not re-exported; all coupling with "former" is removed.
3231

@@ -74,17 +73,20 @@ pub mod exposed
7473
#[ allow( unused_imports ) ]
7574
pub use component_model_types::exposed::*;
7675

76+
#[ doc( inline ) ]
77+
#[ allow( unused_imports ) ]
78+
pub use component_model_types::prelude::*;
7779
}
7880

79-
/// Prelude to use essentials: `use my_module::prelude::*`.
81+
/// Namespace of the module to include with `use module::*`.
8082
#[ cfg( feature = "enabled" ) ]
8183
#[ allow( unused_imports ) ]
8284
pub mod prelude
8385
{
86+
#[ allow( clippy::wildcard_imports ) ]
8487
use super::*;
8588

8689
#[ doc( inline ) ]
8790
#[ allow( unused_imports ) ]
8891
pub use component_model_types::prelude::*;
89-
9092
}

module/core/component_model_meta/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![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_component_model_meta_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_component_model_meta_push.yml) [![docs.rs](https://img.shields.io/docsrs/component_model_meta?color=e3e8f0&logo=docs.rs)](https://docs.rs/component_model_meta) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
66
<!--{ generate.module_header.end }-->
77

8-
A flexible implementation of the Builder pattern supporting nested builders and collection-specific subcomponent_models. Implementation of its derive macro. Should not be used independently, instead use `module::component_model` which relies on the module.
8+
A flexible implementation of the Builder pattern supporting nested builders and collection-specific `subcomponent_models`. Implementation of its derive macro. Should not be used independently, instead use `module::component_model` which relies on the module.
99

1010
Not intended to be used without runtime. This module and runtime is aggregate in `module::component_model` is [here](https://github.com/Wandalen/wTools/tree/master/module/core/component_model).
1111

module/core/component_model_types/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![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_component_model_types_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_component_model_types_push.yml) [![docs.rs](https://img.shields.io/docsrs/component_model_types?color=e3e8f0&logo=docs.rs)](https://docs.rs/component_model_types) [![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%2Fcore%2Fcomponent_model_types%2Fexamples%2Fcomponent_model_types_trivial.rs,RUN_POSTFIX=--example%20module%2Fcore%2Fcomponent_model_types%2Fexamples%2Fcomponent_model_types_trivial.rs/https://github.com/Wandalen/wTools) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
77
<!--{ generate.module_header.end }-->
88

9-
A flexible implementation of the Builder pattern supporting nested builders and collection-specific subcomponent_models. Its compile-time structures and traits that are not generated but reused.
9+
A flexible implementation of the Builder pattern supporting nested builders and collection-specific `subcomponent_models`. Its compile-time structures and traits that are not generated but reused.
1010

1111
## Example: Using Trait Assign
1212

0 commit comments

Comments
 (0)