Trait pipewire_wrapper::wrapper::Wrapper
source · pub trait Wrapperwhere
Self: Deref<Target = Self::RawWrapperType> + DerefMut<Target = Self::RawWrapperType> + AsRef<Self::RawWrapperType> + AsMut<Self::RawWrapperType> + Sized,{
type RawWrapperType: RawWrapper;
// Provided methods
fn into_raw(self) -> *mut <Self::RawWrapperType as RawWrapper>::CType { ... }
fn as_raw(&self) -> *mut <Self::RawWrapperType as RawWrapper>::CType { ... }
}
Expand description
Owned wrapper for the external type. Should be used when external value can be created or dropped from the Rust side, or when Wrapper should have additional fields. Methods wrappers can be implemented in the RawWrapper and used from the both variants. Usually Wrappers have only constructor and drop implementations.
Required Associated Types§
sourcetype RawWrapperType: RawWrapper
type RawWrapperType: RawWrapper
RawWrapper type
Provided Methods§
sourcefn into_raw(self) -> *mut <Self::RawWrapperType as RawWrapper>::CType
fn into_raw(self) -> *mut <Self::RawWrapperType as RawWrapper>::CType
Converts the Wrapper into raw pointer, that must be dropped manually. Used when the external method takes the ownership.
sourcefn as_raw(&self) -> *mut <Self::RawWrapperType as RawWrapper>::CType
fn as_raw(&self) -> *mut <Self::RawWrapperType as RawWrapper>::CType
Raw mutable pointer to the external value.