Return [TypeOptionCellReader] for the given field id.
(&self, field_id: &str)
| 551 | |
| 552 | /// Return [TypeOptionCellReader] for the given field id. |
| 553 | pub fn get_cell_reader(&self, field_id: &str) -> Option<Box<dyn TypeOptionCellReader>> { |
| 554 | let txn = self.collab.transact(); |
| 555 | let field = self.body.fields.get_field(&txn, field_id)?; |
| 556 | drop(txn); |
| 557 | |
| 558 | let field_type = FieldType::from(field.field_type); |
| 559 | let type_option = field.get_any_type_option(field_type.type_id())?; |
| 560 | Some(type_option_cell_reader(type_option, &field_type)) |
| 561 | } |
| 562 | |
| 563 | /// Return [TypeOptionCellWriter] for the given field id. |
| 564 | pub fn get_cell_writer(&self, field_id: &str) -> Option<Box<dyn TypeOptionCellWriter>> { |