1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Retention policy (Rift spec section 9.3).
//!
//! This module defines the [`RetentionPolicy`] enum that controls how long
//! messages are kept in a topic's replay log after they are published.
//! The retention policy is part of a topic's
//! [`TopicProfile`](crate::topic::profile::TopicProfile) and is enforced
//! by the [`TopicEntry::append`](crate::topic::store::TopicEntry::append)
//! method each time a new message is stored.
use Duration;
/// How long messages on a topic are kept before being evicted.
///
/// The retention policy is checked every time a new message is appended
/// to the topic's replay log. Older entries that no longer satisfy the
/// policy are removed immediately, so the log never exceeds the policy's
/// bounds.