Struct leptonica_plumbing::memory::RefCountedExclusive
source · pub struct RefCountedExclusive<T: LeptonicaDestroy> { /* private fields */ }
Expand description
A wrapper for ref counted leptonica pointers that can be safely mutated.
For example if it is the only reference.
Implementations§
source§impl<T: LeptonicaDestroy> RefCountedExclusive<T>
impl<T: LeptonicaDestroy> RefCountedExclusive<T>
sourcepub unsafe fn new(inner: T) -> Self
pub unsafe fn new(inner: T) -> Self
Creates a new ref counted exclusive wrapper
§Safety
It must be safe for this wrapper to destroy (decrement the ref count).
The ref count must have already been incremented before being passed to new
.
The pointer must not be mutated whilst this wrapper exists, except via this wrapper.
source§impl<T: LeptonicaDestroy + LeptonicaClone> RefCountedExclusive<T>
impl<T: LeptonicaDestroy + LeptonicaClone> RefCountedExclusive<T>
sourcepub fn to_ref_counted(self) -> RefCounted<T>
pub fn to_ref_counted(self) -> RefCounted<T>
Convert to a ref counted wrapper
Trait Implementations§
source§impl<T: LeptonicaDestroy> Deref for RefCountedExclusive<T>
impl<T: LeptonicaDestroy> Deref for RefCountedExclusive<T>
source§impl<T: LeptonicaDestroy> DerefMut for RefCountedExclusive<T>
impl<T: LeptonicaDestroy> DerefMut for RefCountedExclusive<T>
source§impl<T: LeptonicaDestroy> Drop for RefCountedExclusive<T>
impl<T: LeptonicaDestroy> Drop for RefCountedExclusive<T>
Auto Trait Implementations§
impl<T> Freeze for RefCountedExclusive<T>where
T: Freeze,
impl<T> RefUnwindSafe for RefCountedExclusive<T>where
T: RefUnwindSafe,
impl<T> Send for RefCountedExclusive<T>where
T: Send,
impl<T> Sync for RefCountedExclusive<T>where
T: Sync,
impl<T> Unpin for RefCountedExclusive<T>where
T: Unpin,
impl<T> UnwindSafe for RefCountedExclusive<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more