Skip to content

Commit c185e03

Browse files
committed
muts
1 parent d678710 commit c185e03

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/mutation_table.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,30 @@ impl MutationTable {
320320
let ri = r.into().0;
321321
table_row_access!(ri, self, make_mutation_table_row)
322322
}
323+
324+
/// Return a view of row `r` of the table.
325+
///
326+
/// # Parameters
327+
///
328+
/// * `r`: the row id.
329+
///
330+
/// # Returns
331+
///
332+
/// * `Some(row view)` if `r` is valid
333+
/// * `None` otherwise
334+
pub fn row_view<M: Into<MutationId> + Copy>(&self, r: M) -> Option<MutationTableRowView> {
335+
let view = MutationTableRowView {
336+
table: self,
337+
id: r.into(),
338+
site: self.site(r)?,
339+
node: self.node(r)?,
340+
parent: self.parent(r)?,
341+
time: self.time(r)?,
342+
derived_state: self.derived_state(r),
343+
metadata: self.raw_metadata(r.into()),
344+
};
345+
Some(view)
346+
}
323347
}
324348

325349
build_owned_table_type!(

0 commit comments

Comments
 (0)