@@ -58,17 +58,20 @@ impl<T> LaneResponse<T> {
58
58
/// to describe alterations to the lane.
59
59
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Form ) ]
60
60
pub enum MapOperation < K , V > {
61
+ /// Update the value associated with a key in the map (or insert an entry if they key does not exist).
61
62
#[ form( tag = "update" ) ]
62
63
Update {
63
64
key : K ,
64
65
#[ form( body) ]
65
66
value : V ,
66
67
} ,
68
+ /// Remove an entry from the map, by key (does nothing if there is no such entry).
67
69
#[ form( tag = "remove" ) ]
68
70
Remove {
69
71
#[ form( header) ]
70
72
key : K ,
71
73
} ,
74
+ /// Remove all entries in the map.
72
75
#[ form( tag = "clear" ) ]
73
76
Clear ,
74
77
}
@@ -79,21 +82,29 @@ pub enum MapOperation<K, V> {
79
82
/// with other implementations.
80
83
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Form , Hash ) ]
81
84
pub enum MapMessage < K , V > {
85
+ /// Update the value associated with a key in the map (or insert an entry if they key does not exist).
82
86
#[ form( tag = "update" ) ]
83
87
Update {
84
88
key : K ,
85
89
#[ form( body) ]
86
90
value : V ,
87
91
} ,
92
+ /// Remove an entry from the map, by key (does nothing if there is no such entry).
88
93
#[ form( tag = "remove" ) ]
89
94
Remove {
90
95
#[ form( header) ]
91
96
key : K ,
92
97
} ,
98
+ /// Remove all entries in the map.
93
99
#[ form( tag = "clear" ) ]
94
100
Clear ,
101
+ /// Retain only the first `n` entries in the map, the remainder are removed. The ordering
102
+ /// used to determine 'first' is the Recon order of the keys. If there are fewer than `n`
103
+ /// entries in the map, this does nothing.
95
104
#[ form( tag = "take" ) ]
96
105
Take ( #[ form( header_body) ] u64 ) ,
106
+ /// Remove the first `n` entries in the map. The ordering used to determine 'first' is the
107
+ /// Recon order of the keys. If there are fewer than `n` entries in the map, it is cleared.
97
108
#[ form( tag = "drop" ) ]
98
109
Drop ( #[ form( header_body) ] u64 ) ,
99
110
}
0 commit comments