Stores `value` in the slot at `index`.
(&self, index: SubqueryIndex, value: ScalarValue)
| 212 | |
| 213 | /// Stores `value` in the slot at `index`. |
| 214 | pub fn set(&self, index: SubqueryIndex, value: ScalarValue) -> Result<()> { |
| 215 | let Some(slot) = self.slots.get(index.as_usize()) else { |
| 216 | return internal_err!( |
| 217 | "ScalarSubqueryResults: result index {} is out of bounds", |
| 218 | index.as_usize() |
| 219 | ); |
| 220 | }; |
| 221 | |
| 222 | let mut slot = slot.lock().unwrap(); |
| 223 | if slot.is_some() { |
| 224 | return internal_err!( |
| 225 | "ScalarSubqueryResults: result for index {} was already populated", |
| 226 | index.as_usize() |
| 227 | ); |
| 228 | } |
| 229 | *slot = Some(value); |
| 230 | |
| 231 | Ok(()) |
| 232 | } |
| 233 | |
| 234 | /// Clears all populated results so the container can be reused. |
| 235 | pub fn clear(&self) { |