Skip to content

Commit 6261c21

Browse files
authored
refactor: tidy up table definitions (#434)
* All tables are now repr(transparent) * Clean up internal field visibility issue for EdgeTable.
1 parent 0389328 commit 6261c21

File tree

8 files changed

+8
-2
lines changed

8 files changed

+8
-2
lines changed

src/edge_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<'a> streaming_iterator::StreamingIterator for EdgeTableRowView<'a> {
145145
#[repr(transparent)]
146146
#[derive(Debug)]
147147
pub struct EdgeTable {
148-
pub(crate) table_: sys::LLEdgeTableRef,
148+
table_: sys::LLEdgeTableRef,
149149
}
150150

151151
impl EdgeTable {

src/individual_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ impl<'a> streaming_iterator::StreamingIterator for IndividualTableRowView<'a> {
101101
/// by types implementing [`std::ops::Deref`] to
102102
/// [`crate::table_views::TableViews`]
103103
#[derive(Debug)]
104+
#[repr(transparent)]
104105
pub struct IndividualTable {
105106
table_: sys::LLIndividualTableRef,
106107
}

src/migration_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl<'a> streaming_iterator::StreamingIterator for MigrationTableRowView<'a> {
163163
/// by types implementing [`std::ops::Deref`] to
164164
/// [`crate::table_views::TableViews`]
165165
#[derive(Debug)]
166+
#[repr(transparent)]
166167
pub struct MigrationTable {
167168
table_: sys::LLMigrationTableRef,
168169
}

src/mutation_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ impl<'a> streaming_iterator::StreamingIterator for MutationTableRowView<'a> {
160160
/// by types implementing [`std::ops::Deref`] to
161161
/// [`crate::table_views::TableViews`]
162162
#[derive(Debug)]
163+
#[repr(transparent)]
163164
pub struct MutationTable {
164165
table_: sys::LLMutationTableRef,
165166
}

src/node_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ impl<'a> streaming_iterator::StreamingIterator for NodeTableRowView<'a> {
144144
/// by types implementing [`std::ops::Deref`] to
145145
/// [`crate::table_views::TableViews`]
146146
#[derive(Debug)]
147+
#[repr(transparent)]
147148
pub struct NodeTable {
148149
table_: sys::LLNodeTableRef,
149150
}

src/provenance.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<'a> streaming_iterator::StreamingIterator for ProvenanceTableRowView<'a> {
137137
/// * The type is enabled by the `"provenance"` feature.
138138
///
139139
#[derive(Debug)]
140+
#[repr(transparent)]
140141
pub struct ProvenanceTable {
141142
table_: sys::LLProvenanceTableRef,
142143
}

src/site_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ impl<'a> streaming_iterator::StreamingIterator for SiteTableRowView<'a> {
130130
/// by types implementing [`std::ops::Deref`] to
131131
/// [`crate::table_views::TableViews`]
132132
#[derive(Debug)]
133+
#[repr(transparent)]
133134
pub struct SiteTable {
134135
table_: sys::LLSiteTableRef,
135136
}

src/table_collection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl TableCollection {
109109
// AHA?
110110
assert!(std::ptr::eq(
111111
&mbox.as_ref().edges as *const ll_bindings::tsk_edge_table_t,
112-
views.edges().table_.as_ref() as *const ll_bindings::tsk_edge_table_t
112+
views.edges().as_ref() as *const ll_bindings::tsk_edge_table_t
113113
));
114114
let mut tables = Self {
115115
inner: mbox,

0 commit comments

Comments
 (0)