Trait windows::Abi [−][src]
pub unsafe trait Abi: Sized + Clone {
type Abi;
type DefaultType: Sized + Clone + PartialEq;
fn ok(value: &Self::DefaultType) -> Result<Self> { ... }
fn abi(&self) -> Self::Abi { ... }
fn set_abi(&mut self) -> *mut Self::Abi { ... }
unsafe fn from_abi(abi: Self::Abi) -> Result<Self> { ... }
fn drop_param(_: &mut Param<'_, Self>) { ... }
}Expand description
Provides a generic way of referring to and converting between a Rust object and its ABI equivalent.
This trait is automatically used by the generated bindings and should not be used directly.
Associated Types
The abi representation of the implementing type.
Safety
Self and Abi must have the same exact in-memory representation.
type DefaultType: Sized + Clone + PartialEq
Provided methods
fn ok(value: &Self::DefaultType) -> Result<Self>
fn ok(value: &Self::DefaultType) -> Result<Self>
Converts from Self::DefaultType to Result<T>.
Returns a pointer for setting the object’s value via an ABI call.
Safety
Casts the ABI representation to a Rust object by taking ownership of the bits. This default implementation is correct for all but interfaces.