pub trait PyWrapperSemverExt: SealedPyWrapper {
type Wrapped;
// Required methods
fn inner_ref_semver(
&self,
) -> LockResult<ConsumedResult<impl MappableDeref<'_, Target = Self::Wrapped>>>;
fn inner_mut_semver(
&mut self,
) -> LockResult<ConsumedResult<impl MappableDerefMut<'_, Target = Self::Wrapped>>>;
fn into_inner_semver(self) -> ConsumedResult<Self::Wrapped>;
}
Expand description
This trait allows you to handle PyWrapperT0 and PyWrapperT1 with the API of PyWrapper<PyWrapperT2>, so you can write future-compatible code.
§NOTE
You must drop the returned MappableDeref and MappableDerefMut, because for the implementations of PyWrapperT1 and PyWrapperT2, they will hold internal locks.
Required Associated Types§
Required Methods§
Sourcefn inner_ref_semver(
&self,
) -> LockResult<ConsumedResult<impl MappableDeref<'_, Target = Self::Wrapped>>>
fn inner_ref_semver( &self, ) -> LockResult<ConsumedResult<impl MappableDeref<'_, Target = Self::Wrapped>>>
For implementations of PyWrapper::<PyWrapperT1> and ::<PyWrapperT2>, locks will be acquired
Sourcefn inner_mut_semver(
&mut self,
) -> LockResult<ConsumedResult<impl MappableDerefMut<'_, Target = Self::Wrapped>>>
fn inner_mut_semver( &mut self, ) -> LockResult<ConsumedResult<impl MappableDerefMut<'_, Target = Self::Wrapped>>>
For implementations of PyWrapper::<PyWrapperT1> and ::<PyWrapperT2>, locks will be acquired
fn into_inner_semver(self) -> ConsumedResult<Self::Wrapped>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.