Trait pipewire_wrapper::wrapper::RawWrapper
source · pub trait RawWrapperwhere
Self: Sized,{
type CType;
// Required methods
fn as_raw_ptr(&self) -> *mut Self::CType;
fn as_raw(&self) -> &Self::CType;
fn from_raw(raw: Self::CType) -> Self;
unsafe fn mut_from_raw_ptr<'a>(raw: *mut Self::CType) -> &'a mut Self;
// Provided methods
unsafe fn from_raw_ptr<'a>(raw: *const Self::CType) -> &'a Self { ... }
fn as_ptr(&self) -> *mut Self { ... }
}
Expand description
Wrapper for the external type, must not be null. By convention, all wrapped structures should with the Ref prefix. #[repr(transparent)] should be used where possible.
Required Associated Types§
Required Methods§
sourcefn as_raw_ptr(&self) -> *mut Self::CType
fn as_raw_ptr(&self) -> *mut Self::CType
Raw ptr to the external type
sourcefn from_raw(raw: Self::CType) -> Self
fn from_raw(raw: Self::CType) -> Self
Creates wrapper from the external value, can be use when external type has no raw pointers.