pub struct Module {
pub filename: HSTRING,
pub file_path: String,
pub version: Version,
pub base: ModuleHandle,
pub runtime: Runtime,
/* private fields */
}
Expand description
Represents a loaded module in memory.
Fields§
§filename: HSTRING
Name of the module. (e.g. "SkyrimSE.exe"
)
file_path: String
File path of the module. (e.g. "SkyrimSE.exe"
)
version: Version
Version information of the module.
base: ModuleHandle
Base module handle if available.
runtime: Runtime
Runtime type of the module.
Implementations§
Source§impl Module
impl Module
Sourcepub fn new() -> Result<Self, ModuleInitError>
pub fn new() -> Result<Self, ModuleInitError>
Initializes a new Module
instance by detecting the currently loaded module.
This method attempts to retrieve the module information from the SKSE_RUNTIME
or fallback to a predefined list of runtime binaries(e.g. SkyrimSE.exe
).
§Errors
An error occurs in the following cases
- If the module handle could not be obtained.
- Module version could not be obtained.
Sourcepub const fn segment(&self, name: SegmentName) -> Segment
pub const fn segment(&self, name: SegmentName) -> Segment
Gets a specific memory segment by SegmentName
.
§Example
use commonlibsse_ng::rel::module::{ModuleState, SegmentName};
ModuleState::map_active(|module| println!("{:?}", module.segment(SegmentName::Textx))).unwrap();
Trait Implementations§
impl Eq for Module
impl StructuralPartialEq for Module
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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