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: HSTRINGName of the module. (e.g. "SkyrimSE.exe")
file_path: StringFile path of the module. (e.g. "SkyrimSE.exe")
version: VersionVersion information of the module.
base: ModuleHandleBase module handle if available.
runtime: RuntimeRuntime 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