Struct rkyv::with::Lock [−][src]
pub struct Lock;
Expand description
A wrapper that locks a lock and serializes the value immutably.
This wrapper can panic under very specific circumstances when:
serialize_with
is called and succeeds in locking the value to serialize it.- Another thread locks the value and panics, poisoning the lock
resolve_with
is called and gets a poisoned value.
Unfortunately, it’s not possible to work around this issue. If your code absolutely must not panic under any circumstances, it’s recommended that you lock your values and then serialize them while locked.
Trait Implementations
impl<F, T, D: ?Sized> DeserializeWith<Immutable<F>, Mutex<T>, D> for Lock where
F: Deserialize<T, D>,
D: Fallible,
impl<F, T, D: ?Sized> DeserializeWith<Immutable<F>, Mutex<T>, D> for Lock where
F: Deserialize<T, D>,
D: Fallible,
impl<F, T, D: ?Sized> DeserializeWith<Immutable<F>, RwLock<T>, D> for Lock where
F: Deserialize<T, D>,
D: Fallible,
impl<F, T, D: ?Sized> DeserializeWith<Immutable<F>, RwLock<T>, D> for Lock where
F: Deserialize<T, D>,
D: Fallible,
Auto Trait Implementations
impl RefUnwindSafe for Lock
impl UnwindSafe for Lock
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
D: Fallible + ?Sized,
F: ?Sized,
W: DeserializeWith<F, T, D>,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
D: Fallible + ?Sized,
F: ?Sized,
W: DeserializeWith<F, T, D>,