Mercurial > hg
diff rust/hg-core/src/revlog/node.rs @ 44502:166349510398
revlog: using two new functions in C capsule from Rust code
We expose `index_length` and `index_node` in the C capsule, so that
the Rust representation of the C index can implement the `RevlogIndex`
trait.
Because our `Node` is actually a one-field struct, we have
to decorate it for direct FFI exchange with the C `char*`
It would be a good thing to get a length from the C layer, but doing
so right now would probably interfere with the upcoming changes that
will happen there for the hash length.
Differential Revision: https://phab.mercurial-scm.org/D8152
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Mon, 13 Jan 2020 19:31:33 +0100 |
parents | 5ac1eecc9c64 |
children | 26114bd6ec60 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs Tue Feb 18 19:11:14 2020 +0100 +++ b/rust/hg-core/src/revlog/node.rs Mon Jan 13 19:31:33 2020 +0100 @@ -44,6 +44,7 @@ /// [`nybbles_len`]: #method.nybbles_len /// [`ExactLengthRequired`]: struct.NodeError#variant.ExactLengthRequired #[derive(Clone, Debug, PartialEq)] +#[repr(transparent)] pub struct Node { data: NodeData, }