We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
project_ref
1 parent dc39a6e commit 381a29bCopy full SHA for 381a29b
src/helper.rs
@@ -0,0 +1,10 @@
1
+use core::ptr;
2
+
3
+use crate::marker::Field;
4
5
+pub fn project_ref<F: Field>(r: &F::Base) -> &F::Type
6
+where
7
+ F::Type: Sized,
8
+{
9
+ unsafe { &*ptr::from_ref(r).byte_add(F::OFFSET).cast() }
10
+}
src/lib.rs
@@ -3,5 +3,6 @@
#![warn(unsafe_op_in_unsafe_fn)]
pub mod compat;
+pub mod helper;
pub mod marker;
pub mod ops;
0 commit comments