Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
570 B
17 lines
570 B
8 months ago
|
// Macro to create structs that will act as opaque pointees. These structs are
|
||
|
// never intended to be dereferenced in Rust.
|
||
|
// This is a workaround until stabilization of [`extern type`].
|
||
|
// TODO: convert to extern type once stabilized.
|
||
|
// [`extern type`]: https://github.com/rust-lang/rust/issues/43467
|
||
|
macro_rules! opaque_pointee {
|
||
|
($name: ident) => {
|
||
|
#[repr(C)]
|
||
|
pub struct $name {
|
||
|
_data: [u8; 0],
|
||
|
_marker: std::marker::PhantomData<(*mut u8, std::marker::PhantomPinned)>,
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
pub(crate) use opaque_pointee;
|