pub struct ModuleId(pub String);Expand description
A unique, deterministic identifier for a module derived from its path relative to the project root.
Examples:
"main"for the entry file"math"formath.cjc"math::linalg"formath/linalg.cjc
Tuple Fields§
§0: StringImplementations§
Source§impl ModuleId
impl ModuleId
Sourcepub fn from_relative_path(path: &Path) -> Self
pub fn from_relative_path(path: &Path) -> Self
Create a ModuleId from a relative path (e.g., math/linalg.cjc → math::linalg).
Sourcepub fn from_import_path(segments: &[String]) -> Self
pub fn from_import_path(segments: &[String]) -> Self
Convert an import path (e.g., ["math", "linalg"]) to a ModuleId.
Sourcepub fn symbol_prefix(&self) -> String
pub fn symbol_prefix(&self) -> String
Return the mangled prefix for symbols in this module. The entry module returns empty string (no prefix for top-level).
Trait Implementations§
Source§impl Ord for ModuleId
impl Ord for ModuleId
Source§impl PartialOrd for ModuleId
impl PartialOrd for ModuleId
impl Eq for ModuleId
impl StructuralPartialEq for ModuleId
Auto Trait Implementations§
impl Freeze for ModuleId
impl RefUnwindSafe for ModuleId
impl Send for ModuleId
impl Sync for ModuleId
impl Unpin for ModuleId
impl UnsafeUnpin for ModuleId
impl UnwindSafe for ModuleId
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