pub struct Reg(/* private fields */);Expand description
Implementations§
Source§impl Reg
impl Reg
Sourcepub const END: Self
pub const END: Self
The terminator of a Reg slice. All slices must have the terminator as their last element.
reg! automatically appends the terminator to the generated slice.
Sourcepub const fn new(name: &'static CStr, func: CFunction) -> Self
pub const fn new(name: &'static CStr, func: CFunction) -> Self
Manually creates a new Reg element intended to be inserted into a slice.
This function is internally called for you by reg!.
Sourcepub const unsafe fn from_raw(raw: luaL_Reg) -> Self
pub const unsafe fn from_raw(raw: luaL_Reg) -> Self
Wraps a pre-existing raw luaL_Reg.
§Safety
namemust either be null or a valid string pointer.funcmust either beNoneor safe to call.
A non-modified luaL_Reg obtained from Reg::into_raw should always be safe to use.
Sourcepub const fn into_raw(self) -> luaL_Reg
pub const fn into_raw(self) -> luaL_Reg
Returns the wrapped luaL_Reg.
The raw luaL_Reg can be safely converted back into a Reg using Reg::from_raw, as long as it is not modified.
Sourcepub const fn name(&self) -> Option<&'static CStr>
pub const fn name(&self) -> Option<&'static CStr>
Returns the stored function name.
Reg::END will return None instead.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Reg
impl !Sync for Reg
impl Freeze for Reg
impl RefUnwindSafe for Reg
impl Unpin for Reg
impl UnsafeUnpin for Reg
impl UnwindSafe for Reg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more