Enum core::ffi::c_void1.30.0[−][src]

#[repr(u8)]
pub enum c_void {
    // some variants omitted
}
Expand description

当用作 指针 时,等效于 C 的 void 类型。

本质上,*const c_void 等效于 C 的 const void*,而 *mut c_void 等效于 C 的 void*。 也就是说,这与 C 的 void 返回类型 (即 Rust 的 () 类型) 不同。

要在 FFI 中对指向不透明类型的指针进行建模,直到 extern type 稳定为止,建议在空字节数组周围使用 newtype 包装器。

有关详细信息,请参见 Nomicon。

如果他们想支持低至 1.1.0 的旧 Rust 编译器,则可以使用 std::os::raw::c_void。 Rust 1.30.0 之后,此定义将其重导出。 有关更多信息,请阅读 RFC 2521。

Trait Implementations

使用给定的格式化程序格式化该值。 Read more

Auto Trait Implementations

Blanket Implementations

获取 self 的 TypeId。 Read more

从拥有的值中一成不变地借用。 Read more

从拥有的值中借用。 Read more

执行转换。

执行转换。

发生转换错误时返回的类型。

执行转换。

发生转换错误时返回的类型。

执行转换。