File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 44// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55// Please see LICENSE files in the repository root for full details.
66
7+ //!
8+ //! This crate defines a [`Clock`] trait that can be used to abstract the
9+ //! way the current time is retrieved. It has two implementation:
10+ //! [`SystemClock`] that uses the system time and [`MockClock`] which is useful
11+ //! for testing.
12+ //!
13+ //! [`MockClock`]: crate::clock::MockClock
14+ //!
15+
716#![ allow( clippy:: module_name_repetitions) ]
817
918use thiserror:: Error ;
Original file line number Diff line number Diff line change 1515//! without caring about the underlying storage backend, and without carrying
1616//! around the generic type parameter.
1717//!
18- //! This crate also defines a [`Clock`] trait that can be used to abstract the
19- //! way the current time is retrieved. It has two implementation:
20- //! [`SystemClock`] that uses the system time and [`MockClock`] which is useful
21- //! for testing.
22- //!
23- //! [`MockClock`]: mas_data_model::clock::MockClock
24- //!
2518//! # Defining a new repository
2619//!
2720//! To define a new repository, you have to:
8679//! and use that error type
8780//! 2. Lookups return an `Result<Option<T>, Self::Error>`, because 'not found'
8881//! errors are usually cases that are handled differently
89- //! 3. Operations that need to record the current type use a [`Clock`]
82+ //! 3. Operations that need to record the current type use a [`mas_data_model:: Clock`]
9083//! parameter. Operations that need to generate new IDs also use a random
9184//! number generator.
9285//! 4. All the methods use an `&mut self`. This is ensures only one operation
You can’t perform that action at this time.
0 commit comments