mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
AnyUserData::is_proxy (#666)
This commit is contained in:
@@ -679,6 +679,14 @@ impl AnyUserData {
|
||||
matches!(type_id, Some(type_id) if type_id == TypeId::of::<T>())
|
||||
}
|
||||
|
||||
/// Checks whether the type of this userdata is a [proxy object] for `T`.
|
||||
///
|
||||
/// [proxy object]: crate::Lua::create_proxy
|
||||
#[inline]
|
||||
pub fn is_proxy<T: 'static>(&self) -> bool {
|
||||
self.is::<UserDataProxy<T>>()
|
||||
}
|
||||
|
||||
/// Borrow this userdata immutably if it is of type `T`.
|
||||
///
|
||||
/// # Errors
|
||||
|
||||
Reference in New Issue
Block a user