#[repr(u8)]pub enum c_void {
// some variants omitted
}Expand description
Equivalent to C’s void type when used as a pointer.
In essence, *const c_void is equivalent to C’s const void*
and *mut c_void is equivalent to C’s void*. That said, this is
not the same as C’s void return type, which is Rust’s () type.
To model pointers to opaque types in FFI, until extern type is
stabilized, it is recommended to use a newtype wrapper around an empty
byte array. See the Nomicon for details.
One could use std::os::raw::c_void if they want to support old Rust
compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by
this definition. For more information, please read RFC 2521.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for c_void
impl Send for c_void
impl Sync for c_void
impl Unpin for c_void
impl UnwindSafe for c_void
Blanket Implementations§
source§impl<T> Also for T
impl<T> Also for T
source§impl<T> AnyExt for Twhere
T: Any,
impl<T> AnyExt for Twhere
T: Any,
source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Available on crate feature
any only.Returns the type name of
self. Read moresource§fn as_any_ref(&self) -> &dyn Anywhere
Self: Sized,
fn as_any_ref(&self) -> &dyn Anywhere
Self: Sized,
Available on crate feature
any only.source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Available on crate feature
any only.source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
source§fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Reswhere
Self: Sized,
fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Reswhere
Self: Sized,
Available on crate feature
result only.Apply a function which takes the parameter by value.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Mem for Twhere
T: ?Sized,
impl<T> Mem for Twhere
T: ?Sized,
source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Available on crate feature
mem only.Whether dropping values of this type matters.
source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Available on crate feature
mem only.Returns
true if dropping values of this type matters.source§fn mem_drop(self)where
Self: Sized,
fn mem_drop(self)where
Self: Sized,
Available on crate feature
mem only.Drops
self by running its destructor.source§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Available on crate feature
mem only.Forgets about
self without running its destructor.source§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Available on crate feature
mem only.Replaces
self with other, returning the previous value of self.source§fn mem_take(&mut self) -> Selfwhere
Self: Default,
fn mem_take(&mut self) -> Selfwhere
Self: Default,
Available on crate feature
mem only.Replaces
self with its default value, returning the previous value of self.source§fn mem_swap(&mut self, other: &mut Self)where
Self: Sized,
fn mem_swap(&mut self, other: &mut Self)where
Self: Sized,
Available on crate feature
mem only.Swaps the value of
self and other without deinitializing either one.source§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
Available on crate features
mem and unsafe_mem only.source§impl<T> Size for T
impl<T> Size for T
source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Available on crate feature
mem only.The alignment of this type in bytes.
source§const BYTE_SIZE: usize = _
const BYTE_SIZE: usize = _
Available on crate feature
mem only.The size of this type in bytes.
source§const PTR_SIZE: usize = 8usize
const PTR_SIZE: usize = 8usize
Available on crate feature
mem only.The size of a pointer in bytes, for the current platform.
source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Available on crate feature
mem only.Returns the alignment of this type in bytes.