@@ -20,17 +20,17 @@ use crate::{
20
20
} ;
21
21
22
22
#[ derive( Debug , Clone , Copy ) ]
23
- pub struct PromiseAllRecord < ' a > {
24
- promise_capability : & ' a PromiseCapability < ' a > ,
25
- remaining_unresolved_promise_count : u32 ,
26
- result_array : Array < ' a > ,
23
+ pub struct PromiseAllRecordHeapData < ' a > {
24
+ pub promise_capability : & ' a PromiseCapability < ' a > ,
25
+ pub remaining_unresolved_promise_count : u32 ,
26
+ pub result_array : Array < ' a > ,
27
27
}
28
28
29
29
#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
30
30
#[ repr( transparent) ]
31
- pub struct PromiseAllRecordHeapData < ' a > ( BaseIndex < ' a , PromiseAllRecord < ' a > > ) ;
31
+ pub struct PromiseAllRecord < ' a > ( pub ( crate ) BaseIndex < ' a , PromiseAllRecordHeapData < ' a > > ) ;
32
32
33
- impl < ' a > PromiseAllRecord < ' a > {
33
+ impl < ' a > PromiseAllRecordHeapData < ' a > {
34
34
pub ( crate ) fn new (
35
35
agent : & mut Agent ,
36
36
promise_capability : & ' a PromiseCapability < ' a > ,
@@ -81,47 +81,47 @@ impl<'a> PromiseAllRecord<'a> {
81
81
}
82
82
}
83
83
84
- impl PromiseAllRecordHeapData < ' _ > {
84
+ impl PromiseAllRecord < ' _ > {
85
85
pub ( crate ) const fn get_index ( self ) -> usize {
86
86
self . 0 . into_index ( )
87
87
}
88
88
}
89
89
90
- impl Index < PromiseAllRecordHeapData < ' _ > > for Agent {
91
- type Output = PromiseAllRecord < ' static > ;
90
+ impl Index < PromiseAllRecord < ' _ > > for Agent {
91
+ type Output = PromiseAllRecordHeapData < ' static > ;
92
92
93
- fn index ( & self , index : PromiseAllRecordHeapData ) -> & Self :: Output {
93
+ fn index ( & self , index : PromiseAllRecord ) -> & Self :: Output {
94
94
& self . heap . promise_all_records [ index]
95
95
}
96
96
}
97
97
98
- impl IndexMut < PromiseAllRecordHeapData < ' _ > > for Agent {
99
- fn index_mut ( & mut self , index : PromiseAllRecordHeapData ) -> & mut Self :: Output {
98
+ impl IndexMut < PromiseAllRecord < ' _ > > for Agent {
99
+ fn index_mut ( & mut self , index : PromiseAllRecord ) -> & mut Self :: Output {
100
100
& mut self . heap . promise_all_records [ index]
101
101
}
102
102
}
103
103
104
- impl Index < PromiseAllRecordHeapData < ' _ > > for Vec < Option < PromiseAllRecord < ' static > > > {
105
- type Output = PromiseAllRecord < ' static > ;
104
+ impl Index < PromiseAllRecord < ' _ > > for Vec < Option < PromiseAllRecordHeapData < ' static > > > {
105
+ type Output = PromiseAllRecordHeapData < ' static > ;
106
106
107
- fn index ( & self , index : PromiseAllRecordHeapData ) -> & Self :: Output {
107
+ fn index ( & self , index : PromiseAllRecord ) -> & Self :: Output {
108
108
self . get ( index. get_index ( ) )
109
109
. expect ( "PromiseAllRecord out of bounds" )
110
110
. as_ref ( )
111
111
. expect ( "PromiseAllRecord slot empty" )
112
112
}
113
113
}
114
114
115
- impl IndexMut < PromiseAllRecordHeapData < ' _ > > for Vec < Option < PromiseAllRecord < ' static > > > {
116
- fn index_mut ( & mut self , index : PromiseAllRecordHeapData ) -> & mut Self :: Output {
115
+ impl IndexMut < PromiseAllRecord < ' _ > > for Vec < Option < PromiseAllRecordHeapData < ' static > > > {
116
+ fn index_mut ( & mut self , index : PromiseAllRecord ) -> & mut Self :: Output {
117
117
self . get_mut ( index. get_index ( ) )
118
118
. expect ( "PromiseAllRecord out of bounds" )
119
119
. as_mut ( )
120
120
. expect ( "PromiseAllRecord slot empty" )
121
121
}
122
122
}
123
123
124
- impl HeapMarkAndSweep for PromiseAllRecord < ' static > {
124
+ impl HeapMarkAndSweep for PromiseAllRecordHeapData < ' static > {
125
125
fn mark_values ( & self , queues : & mut WorkQueues ) {
126
126
self . result_array . mark_values ( queues) ;
127
127
self . promise_capability . mark_values ( queues) ;
@@ -133,8 +133,8 @@ impl HeapMarkAndSweep for PromiseAllRecord<'static> {
133
133
}
134
134
}
135
135
136
- unsafe impl Bindable for PromiseAllRecord < ' _ > {
137
- type Of < ' a > = PromiseAllRecord < ' a > ;
136
+ unsafe impl Bindable for PromiseAllRecordHeapData < ' _ > {
137
+ type Of < ' a > = PromiseAllRecordHeapData < ' a > ;
138
138
139
139
#[ inline( always) ]
140
140
fn unbind ( self ) -> Self :: Of < ' static > {
@@ -147,7 +147,7 @@ unsafe impl Bindable for PromiseAllRecord<'_> {
147
147
}
148
148
}
149
149
150
- impl HeapMarkAndSweep for PromiseAllRecordHeapData < ' static > {
150
+ impl HeapMarkAndSweep for PromiseAllRecord < ' static > {
151
151
fn mark_values ( & self , queues : & mut WorkQueues ) {
152
152
queues. promise_all_records . push ( * self ) ;
153
153
}
@@ -157,8 +157,8 @@ impl HeapMarkAndSweep for PromiseAllRecordHeapData<'static> {
157
157
}
158
158
}
159
159
160
- unsafe impl Bindable for PromiseAllRecordHeapData < ' _ > {
161
- type Of < ' a > = PromiseAllRecordHeapData < ' a > ;
160
+ unsafe impl Bindable for PromiseAllRecord < ' _ > {
161
+ type Of < ' a > = PromiseAllRecord < ' a > ;
162
162
163
163
#[ inline( always) ]
164
164
fn unbind ( self ) -> Self :: Of < ' static > {
@@ -171,10 +171,10 @@ unsafe impl Bindable for PromiseAllRecordHeapData<'_> {
171
171
}
172
172
}
173
173
174
- impl < ' a > CreateHeapData < PromiseAllRecord < ' a > , PromiseAllRecordHeapData < ' a > > for Heap {
175
- fn create ( & mut self , data : PromiseAllRecord < ' a > ) -> PromiseAllRecordHeapData < ' a > {
174
+ impl < ' a > CreateHeapData < PromiseAllRecordHeapData < ' a > , PromiseAllRecord < ' a > > for Heap {
175
+ fn create ( & mut self , data : PromiseAllRecordHeapData < ' a > ) -> PromiseAllRecord < ' a > {
176
176
self . promise_all_records . push ( Some ( data. unbind ( ) ) ) ;
177
- self . alloc_counter += core:: mem:: size_of :: < Option < PromiseAllRecord < ' static > > > ( ) ;
178
- PromiseAllRecordHeapData ( BaseIndex :: last ( & self . promise_all_records ) )
177
+ self . alloc_counter += core:: mem:: size_of :: < Option < PromiseAllRecordHeapData < ' static > > > ( ) ;
178
+ PromiseAllRecord ( BaseIndex :: last ( & self . promise_all_records ) )
179
179
}
180
180
}
0 commit comments