From: Ian Jackson Date: Fri, 15 Nov 2024 16:17:54 +0000 (+0000) Subject: provide as_mut X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=9153509268207513243665b56de60c6b8bc16785;p=manually-boxed provide as_mut --- diff --git a/src/lib.rs b/src/lib.rs index ec245ab..2873b65 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -218,6 +218,12 @@ pub unsafe trait IsTokenMut<'a>: IsTokenRef<'a> + Sized + Sealed { TokenMut(PhantomData) } + /// Obtains a new ZST token from a borrow that might be of a real object. + #[inline] + fn as_mut<'r, 's: 'r>(&'s mut self) -> TokenMut<'r> where 'a: 'r { + TokenMut(PhantomData) + } + /// Borrows from a small, fixed, number of multiple `Ptr` /// /// Call