Skip to content

Commit e81a32b

Browse files
fee1-deadLegNeato
authored andcommitted
Add Module::as_inner method
1 parent 2479a9c commit e81a32b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/cust/src/module.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ impl Module {
418418
}
419419
}
420420

421+
// Get the inner `CUmodule` from the `Module`. If you use this handle elsewhere,
422+
// make sure not to use it after the module has been dropped. Or ManuallyDrop the struct to be safe.
423+
pub fn as_inner(&self) -> driver_sys::CUmodule {
424+
self.inner
425+
}
426+
421427
/// Destroy a `Module`, returning an error.
422428
///
423429
/// Destroying a module can return errors from previous asynchronous work. This function

0 commit comments

Comments
 (0)