@@ -20,17 +20,17 @@ use crate::{
20
20
} ;
21
21
22
22
#[ derive( Debug , Clone , Copy ) ]
23
- pub struct PromiseAllRecordHeapData < ' a > {
23
+ pub struct PromiseAllRecord < ' a > {
24
24
pub remaining_unresolved_promise_count : u32 ,
25
25
pub result_array : Array < ' a > ,
26
26
pub promise : Promise < ' a > ,
27
27
}
28
28
29
29
#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
30
30
#[ repr( transparent) ]
31
- pub struct PromiseAllRecord < ' a > ( pub ( crate ) BaseIndex < ' a , PromiseAllRecordHeapData < ' a > > ) ;
31
+ pub struct PromiseAll < ' a > ( pub ( crate ) BaseIndex < ' a , PromiseAllRecord < ' a > > ) ;
32
32
33
- impl < ' a > PromiseAllRecordHeapData < ' a > {
33
+ impl < ' a > PromiseAllRecord < ' a > {
34
34
pub ( crate ) fn on_promise_fufilled (
35
35
& mut self ,
36
36
agent : & mut Agent ,
@@ -51,47 +51,47 @@ impl<'a> PromiseAllRecordHeapData<'a> {
51
51
}
52
52
}
53
53
54
- impl PromiseAllRecord < ' _ > {
54
+ impl PromiseAll < ' _ > {
55
55
pub ( crate ) const fn get_index ( self ) -> usize {
56
56
self . 0 . into_index ( )
57
57
}
58
58
}
59
59
60
- impl Index < PromiseAllRecord < ' _ > > for Agent {
61
- type Output = PromiseAllRecordHeapData < ' static > ;
60
+ impl Index < PromiseAll < ' _ > > for Agent {
61
+ type Output = PromiseAllRecord < ' static > ;
62
62
63
- fn index ( & self , index : PromiseAllRecord ) -> & Self :: Output {
63
+ fn index ( & self , index : PromiseAll ) -> & Self :: Output {
64
64
& self . heap . promise_all_records [ index]
65
65
}
66
66
}
67
67
68
- impl IndexMut < PromiseAllRecord < ' _ > > for Agent {
69
- fn index_mut ( & mut self , index : PromiseAllRecord ) -> & mut Self :: Output {
68
+ impl IndexMut < PromiseAll < ' _ > > for Agent {
69
+ fn index_mut ( & mut self , index : PromiseAll ) -> & mut Self :: Output {
70
70
& mut self . heap . promise_all_records [ index]
71
71
}
72
72
}
73
73
74
- impl Index < PromiseAllRecord < ' _ > > for Vec < Option < PromiseAllRecordHeapData < ' static > > > {
75
- type Output = PromiseAllRecordHeapData < ' static > ;
74
+ impl Index < PromiseAll < ' _ > > for Vec < Option < PromiseAllRecord < ' static > > > {
75
+ type Output = PromiseAllRecord < ' static > ;
76
76
77
- fn index ( & self , index : PromiseAllRecord ) -> & Self :: Output {
77
+ fn index ( & self , index : PromiseAll ) -> & Self :: Output {
78
78
self . get ( index. get_index ( ) )
79
79
. expect ( "PromiseAllRecord out of bounds" )
80
80
. as_ref ( )
81
81
. expect ( "PromiseAllRecord slot empty" )
82
82
}
83
83
}
84
84
85
- impl IndexMut < PromiseAllRecord < ' _ > > for Vec < Option < PromiseAllRecordHeapData < ' static > > > {
86
- fn index_mut ( & mut self , index : PromiseAllRecord ) -> & mut Self :: Output {
85
+ impl IndexMut < PromiseAll < ' _ > > for Vec < Option < PromiseAllRecord < ' static > > > {
86
+ fn index_mut ( & mut self , index : PromiseAll ) -> & mut Self :: Output {
87
87
self . get_mut ( index. get_index ( ) )
88
88
. expect ( "PromiseAllRecord out of bounds" )
89
89
. as_mut ( )
90
90
. expect ( "PromiseAllRecord slot empty" )
91
91
}
92
92
}
93
93
94
- impl HeapMarkAndSweep for PromiseAllRecordHeapData < ' static > {
94
+ impl HeapMarkAndSweep for PromiseAllRecord < ' static > {
95
95
fn mark_values ( & self , queues : & mut WorkQueues ) {
96
96
self . result_array . mark_values ( queues) ;
97
97
}
@@ -101,8 +101,8 @@ impl HeapMarkAndSweep for PromiseAllRecordHeapData<'static> {
101
101
}
102
102
}
103
103
104
- unsafe impl Bindable for PromiseAllRecordHeapData < ' _ > {
105
- type Of < ' a > = PromiseAllRecordHeapData < ' a > ;
104
+ unsafe impl Bindable for PromiseAllRecord < ' _ > {
105
+ type Of < ' a > = PromiseAllRecord < ' a > ;
106
106
107
107
#[ inline( always) ]
108
108
fn unbind ( self ) -> Self :: Of < ' static > {
@@ -115,7 +115,7 @@ unsafe impl Bindable for PromiseAllRecordHeapData<'_> {
115
115
}
116
116
}
117
117
118
- impl HeapMarkAndSweep for PromiseAllRecord < ' static > {
118
+ impl HeapMarkAndSweep for PromiseAll < ' static > {
119
119
fn mark_values ( & self , queues : & mut WorkQueues ) {
120
120
queues. promise_all_records . push ( * self ) ;
121
121
}
@@ -125,8 +125,8 @@ impl HeapMarkAndSweep for PromiseAllRecord<'static> {
125
125
}
126
126
}
127
127
128
- unsafe impl Bindable for PromiseAllRecord < ' _ > {
129
- type Of < ' a > = PromiseAllRecord < ' a > ;
128
+ unsafe impl Bindable for PromiseAll < ' _ > {
129
+ type Of < ' a > = PromiseAll < ' a > ;
130
130
131
131
#[ inline( always) ]
132
132
fn unbind ( self ) -> Self :: Of < ' static > {
@@ -139,10 +139,10 @@ unsafe impl Bindable for PromiseAllRecord<'_> {
139
139
}
140
140
}
141
141
142
- impl < ' a > CreateHeapData < PromiseAllRecordHeapData < ' a > , PromiseAllRecord < ' a > > for Heap {
143
- fn create ( & mut self , data : PromiseAllRecordHeapData < ' a > ) -> PromiseAllRecord < ' a > {
142
+ impl < ' a > CreateHeapData < PromiseAllRecord < ' a > , PromiseAll < ' a > > for Heap {
143
+ fn create ( & mut self , data : PromiseAllRecord < ' a > ) -> PromiseAll < ' a > {
144
144
self . promise_all_records . push ( Some ( data. unbind ( ) ) ) ;
145
- self . alloc_counter += core:: mem:: size_of :: < Option < PromiseAllRecordHeapData < ' static > > > ( ) ;
146
- PromiseAllRecord ( BaseIndex :: last ( & self . promise_all_records ) )
145
+ self . alloc_counter += core:: mem:: size_of :: < Option < PromiseAllRecord < ' static > > > ( ) ;
146
+ PromiseAll ( BaseIndex :: last ( & self . promise_all_records ) )
147
147
}
148
148
}
0 commit comments