Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 46141a8

Browse files
[autofix.ci] apply automated fixes
1 parent 1a5e29c commit 46141a8

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/pages/storey/container-impl.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ In this section, you will find examples of custom containers with their full cod
1616
# Guides
1717

1818
- [MyMap](container-impl/my-map)
19-

src/pages/storey/container-impl/my-map.mdx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,16 @@ The `MyMapAccess` struct is our accessor. It's a facade that's used to actually
9898
the collection given a `Storage` instance - this is usually a subspace of the "root" storage
9999
backend.
100100

101-
The [`Storable`] trait is the main trait a container must implement. The associated types tell the framework:
101+
The [`Storable`] trait is the main trait a container must implement. The associated types tell the
102+
framework:
102103

103-
| Associated type | Details |
104-
|-------------------|-------------------------------------------------------------------------|
105-
| `Kind` | We put `NonTerminal` here to signify our container creates subkeys rather than just saving data at the root. |
106-
| `Accessor` | The accessor type. `MyMapAccess` in our case. |
104+
| Associated type | Details |
105+
| --------------- | ------------------------------------------------------------------------------------------------------------ |
106+
| `Kind` | We put `NonTerminal` here to signify our container creates subkeys rather than just saving data at the root. |
107+
| `Accessor` | The accessor type. `MyMapAccess` in our case. |
107108

108-
The method `access_impl` produces an accessor given a storage abstraction (usually representing a "slice" of the underlying storage.)
109+
The method `access_impl` produces an accessor given a storage abstraction (usually representing a
110+
"slice" of the underlying storage.)
109111

110112
`MyMap::access` is an access method in cases where you're using the container as a top-level
111113
container.
@@ -205,17 +207,17 @@ assert_eq!(access.entry(2).get().unwrap(), Some(200));
205207

206208
To be continued...
207209

208-
| Associated type | Details |
209-
|-------------------|-------------------------------------------------------------------------|
210-
| `Key` | The key type to be returned by iterators. Here a tuple of `u32` and the key type of the inner container. |
211-
| `KeyDecodeError` | The error to be returned on invalid key data. Here we don't care, so we use `()`. In production, use a proper error type. |
212-
| `Value` | The value type to be returned by iterators. Here it's delegated to the inner container. |
213-
| `ValueDecodeError`| The error type for invalid value data. Delegated to the inner container. |
214-
215-
The methods:
216-
| Method | Function |
217-
|----------------|-----------------------------------------------------------------------------|
218-
| `decode_value` | Used for iteration. This is how the framework knows how to decode values given raw data. |
210+
| Associated type | Details |
211+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
212+
| `Key` | The key type to be returned by iterators. Here a tuple of `u32` and the key type of the inner container. |
213+
| `KeyDecodeError` | The error to be returned on invalid key data. Here we don't care, so we use `()`. In production, use a proper error type. |
214+
| `Value` | The value type to be returned by iterators. Here it's delegated to the inner container. |
215+
| `ValueDecodeError` | The error type for invalid value data. Delegated to the inner container. |
216+
217+
The methods: | Method | Function |
218+
|----------------|-----------------------------------------------------------------------------| |
219+
`decode_value` | Used for iteration. This is how the framework knows how to decode values given raw
220+
data. |
219221

220222
```
221223
impl<V> IterableStorable for MyMap<V>

0 commit comments

Comments
 (0)