Module py_wrapper

Module py_wrapper 

Source
Expand description

When you want to implement a pyclass that can obtain ownership of the internal value in a semantically compatible way, you can use this module.

Pay attention to this module’s:

Structs§

ConsumedError
This error indicates that the internal value has been consumed, i.e., its ownership has been moved out.
LockError
This error indicates that the internal value has already been mutably borrowed. At this point, you must wait for other code to release the lock.
PyWrapper
You can wrap the desired internal value in this structure to implement a pyclass that can obtain ownership of the internal value.

Traits§

MappableDeref
This trait provides compatibility between &T and parking_lot::RwLockReadGuard
MappableDerefMut
This trait provides compatibility between [&mut T] and parking_lot::RwLockWriteGuard
PyWrapperSemverExt
This trait allows you to handle PyWrapperT0 and PyWrapperT1 with the API of PyWrapper<PyWrapperT2>, so you can write future-compatible code.

Type Aliases§

ConsumedResult
LockResult
PyWrapperT0
Can only obtain alias references
PyWrapperT1
Can obtain alias references and mutable references
PyWrapperT2
Can obtain alias references, mutable references, and ownership