Struct persistent_buff::PersistentBuff
source · [−]pub struct PersistentBuff { /* private fields */ }
Expand description
Strut to request the persistent buff and manage it safely
.
When acquiring the buffer you need to validate/init it to a known sate.
Implementations
sourceimpl PersistentBuff
impl PersistentBuff
sourcepub fn take_managed() -> Option<Self>
pub fn take_managed() -> Option<Self>
Take a managed version fo the persistent buff. Allow to check if the buffer is valid or not before usage. Note that vs the Self::take function, you will lose some bytes for storage of the marker.
sourcepub unsafe fn steal_managed() -> Self
pub unsafe fn steal_managed() -> Self
Steal a managed version for the persistent buff without check. See Self::take_managed
Safety
Calling this function could allow to have two mutable reference to the same buffer. Make sure to only have one reference at a time to avoid multiple mutable reference.
Auto Trait Implementations
impl RefUnwindSafe for PersistentBuff
impl !Send for PersistentBuff
impl !Sync for PersistentBuff
impl Unpin for PersistentBuff
impl !UnwindSafe for PersistentBuff
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more