Skip to content

Commit

Permalink
Assert impl Send+Sync for Graph and Txn (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwalker committed Nov 25, 2023
1 parent 6c9ba46 commit 3d02fa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,8 @@ impl Graph {
q.execute(db, self.config.fetch_size, connection).await
}
}

const _: () = {
const fn assert_send_sync<T: ?Sized + Send + Sync>() {}
assert_send_sync::<Graph>();
};
5 changes: 5 additions & 0 deletions lib/src/txn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ impl Txn {
}
}

const _: () = {
const fn assert_send_sync<T: ?Sized + Send + Sync>() {}
assert_send_sync::<Txn>();
};

pub trait TransactionHandle: private::Handle {}

impl TransactionHandle for Txn {}
Expand Down

0 comments on commit 3d02fa8

Please sign in to comment.