Skip to content

Commit 606bcff

Browse files
authored
Structural changes to patterns subfolder (#219)
1 parent e3ed513 commit 606bcff

23 files changed

+50
-98
lines changed

SUMMARY.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,33 @@
1010
- [Finalisation in Destructors](./idioms/dtor-finally.md)
1111
- [`mem::{take(_), replace(_)}`](./idioms/mem-replace.md)
1212
- [On-Stack Dynamic Dispatch](./idioms/on-stack-dyn-dispatch.md)
13-
- [Foreign function interface usage](./idioms/ffi-intro.md)
14-
- [Idiomatic Errors](./idioms/ffi-errors.md)
15-
- [Accepting Strings](./idioms/ffi-accepting-strings.md)
16-
- [Passing Strings](./idioms/ffi-passing-strings.md)
13+
- [Foreign function interface (FFI)](./idioms/ffi/intro.md)
14+
- [Idiomatic Errors](./idioms/ffi/errors.md)
15+
- [Accepting Strings](./idioms/ffi/accepting-strings.md)
16+
- [Passing Strings](./idioms/ffi/passing-strings.md)
1717
- [Iterating over an `Option`](./idioms/option-iter.md)
1818
- [Pass Variables to Closure](./idioms/pass-var-to-closure.md)
1919
- [Privacy For Extensibility](./idioms/priv-extend.md)
2020
- [Easy doc initialization](./idioms/rustdoc-init.md)
2121
- [Temporary mutability](./idioms/temporary-mutability.md)
2222

2323
- [Design Patterns](./patterns/index.md)
24-
- [Builder](./patterns/builder.md)
25-
- [Compose Structs](./patterns/compose-structs.md)
26-
- [Entry API](./patterns/entry.md)
27-
- [Foreign function interface usage](./patterns/ffi-intro.md)
28-
- [Object-Based APIs](./patterns/ffi-export.md)
29-
- [Type Consolidation into Wrappers](./patterns/ffi-wrappers.md)
30-
- [Fold](./patterns/fold.md)
31-
- [Interpreter](./patterns/interpreter.md)
32-
- [Newtype](./patterns/newtype.md)
33-
- [RAII Guards](./patterns/RAII.md)
34-
- [Prefer Small Crates](./patterns/small-crates.md)
35-
- [Strategy](./patterns/strategy.md)
36-
- [Contain unsafety in small modules](./patterns/unsafe-mods.md)
37-
- [Visitor](./patterns/visitor.md)
24+
- [Behavioural](./patterns/behavioural/intro.md)
25+
- [Interpreter](./patterns/behavioural/interpreter.md)
26+
- [Newtype](./patterns/behavioural/newtype.md)
27+
- [RAII Guards](./patterns/behavioural/RAII.md)
28+
- [Strategy](./patterns/behavioural/strategy.md)
29+
- [Visitor](./patterns/behavioural/visitor.md)
30+
- [Creational](./patterns/creational/intro.md)
31+
- [Builder](./patterns/creational/builder.md)
32+
- [Fold](./patterns/creational/fold.md)
33+
- [Structural](./patterns/structural/intro.md)
34+
- [Compose Structs](./patterns/structural/compose-structs.md)
35+
- [Prefer Small Crates](./patterns/structural/small-crates.md)
36+
- [Contain unsafety in small modules](./patterns/structural/unsafe-mods.md)
37+
- [Foreign function interface (FFI)](./patterns/ffi/intro.md)
38+
- [Object-Based APIs](./patterns/ffi/export.md)
39+
- [Type Consolidation into Wrappers](./patterns/ffi/wrappers.md)
3840

3941
- [Anti-patterns](./anti_patterns/index.md)
4042
- [`#[deny(warnings)]`](./anti_patterns/deny-warnings.md)
File renamed without changes.
File renamed without changes.

idioms/ffi-intro.md renamed to idioms/ffi/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ traps for inexperienced users of `unsafe` Rust.
66

77
This section contains idioms that may be useful when doing FFI.
88

9-
1. [Idiomatic Errors](./ffi-errors.md) - Error handling with integer codes and
9+
1. [Idiomatic Errors](./errors.md) - Error handling with integer codes and
1010
sentinel return values (such as `NULL` pointers)
1111

12-
2. [Accepting Strings](./ffi-accepting-strings.md) with minimal unsafe code
12+
2. [Accepting Strings](./accepting-strings.md) with minimal unsafe code
1313

14-
3. [Passing Strings](./ffi-passing-strings.md) to FFI functions
14+
3. [Passing Strings](./passing-strings.md) to FFI functions
File renamed without changes.
File renamed without changes.
File renamed without changes.

patterns/behavioural/intro.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Behavioural Patterns
2+
3+
From [Wikipedia](https://en.wikipedia.org/wiki/Behavioral_pattern):
4+
5+
> Design patterns that identify common communication patterns among objects.
6+
> By doing so, these patterns increase flexibility in carrying out communication.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)