summaryrefslogtreecommitdiff
path: root/src/thread.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2022-12-19 22:11:52 +0000
committerAlex Orlenko <zxteam@protonmail.com>2022-12-19 22:26:44 +0000
commitc60f633a62e62b33173cc5567b17dd005a89e6cc (patch)
treeb472200b7567ee7ce00fd852767da1b8e24d5afd /src/thread.rs
parent56abc4a700b246dcd4b6c0b0a818779577067cc2 (diff)
downloadmlua-c60f633a62e62b33173cc5567b17dd005a89e6cc.zip
Add "unstable" feature flag.
Hide owned types under the new feature flag. Drop OwnedString/OwnedThread types (unlikely they are useful).
Diffstat (limited to 'src/thread.rs')
-rw-r--r--src/thread.rs19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/thread.rs b/src/thread.rs
index 4e5bd9e..dfce272 100644
--- a/src/thread.rs
+++ b/src/thread.rs
@@ -3,7 +3,7 @@ use std::os::raw::c_int;
use crate::error::{Error, Result};
use crate::ffi;
-use crate::types::{LuaOwnedRef, LuaRef};
+use crate::types::LuaRef;
use crate::util::{check_stack, error_traceback_thread, pop_error, StackGuard};
use crate::value::{FromLuaMulti, ToLuaMulti};
@@ -47,17 +47,6 @@ pub enum ThreadStatus {
#[derive(Clone, Debug)]
pub struct Thread<'lua>(pub(crate) LuaRef<'lua>);
-/// Owned handle to an internal Lua thread.
-#[derive(Clone, Debug)]
-pub struct OwnedThread(pub(crate) LuaOwnedRef);
-
-impl OwnedThread {
- /// Get borrowed handle to the underlying Lua thread.
- pub const fn to_ref(&self) -> Thread {
- Thread(self.0.to_ref())
- }
-}
-
/// Thread (coroutine) representation as an async [`Future`] or [`Stream`].
///
/// Requires `feature = "async"`
@@ -346,12 +335,6 @@ impl<'lua> Thread<'lua> {
protect_lua!(state, 0, 0, |_| ffi::luaL_sandboxthread(thread))
}
}
-
- /// Convert this handle to owned version.
- #[inline]
- pub fn into_owned(self) -> OwnedThread {
- OwnedThread(self.0.into_owned())
- }
}
impl<'lua> PartialEq for Thread<'lua> {