summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 42eb51b..2fcbe12 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -143,6 +143,17 @@ impl<'a, T: ?Sized> ConstLtPtr<'a, T> {
             _lt: PhantomData,
         }
     }
+
+    /// Returns this `ConstLtPtr` as a raw pointer.
+    ///
+    /// # Safety
+    ///
+    /// This function is unsafe as an advisory: the returned raw pointer loses
+    /// the lifetime.
+    #[inline]
+    pub const unsafe fn as_raw(&self) -> *const T {
+        self.raw
+    }
 }
 
 impl<'a, T: ?Sized> MutLtPtr<'a, T> {
@@ -160,4 +171,15 @@ impl<'a, T: ?Sized> MutLtPtr<'a, T> {
             _lt: PhantomData,
         }
     }
+
+    /// Returns this `MutLtPtr` as a raw pointer.
+    ///
+    /// # Safety
+    ///
+    /// This function is unsafe as an advisory: the returned raw pointer loses
+    /// the lifetime.
+    #[inline]
+    pub const unsafe fn as_raw(&self) -> *mut T {
+        self.raw
+    }
 }