pub struct ModuleDetector<'a> { /* private fields */ }Expand description
模块边界检测器
Implementations§
Source§impl<'a> ModuleDetector<'a>
impl<'a> ModuleDetector<'a>
pub fn new(graph: &'a KnowledgeGraph) -> Self
Sourcepub fn detect(&self) -> Vec<ModuleCluster>
pub fn detect(&self) -> Vec<ModuleCluster>
执行模块检测,返回模块聚类列表
算法(演进计划 T1.2):Leiden 社区检测(CPM 质量函数)在跨文件
Imports/Calls/DependsOn 依赖图上划分 File 节点社区;每个社区命名
走 community_name 三档规则(公共目录前缀 → 文件数最多目录 →
module_{n}),重名时追加文件 stem 消歧(模块名是 wiki 产物文件名
的唯一来源,重名会互相覆盖)。
cohesion/coupling 仅作为描述性元数据写入 ModuleCluster(见 count_edges 注释:历史上阈值拒绝导致“全有或全无“的脆弱分界)。
Auto Trait Implementations§
impl<'a> Freeze for ModuleDetector<'a>
impl<'a> RefUnwindSafe for ModuleDetector<'a>
impl<'a> Send for ModuleDetector<'a>
impl<'a> Sync for ModuleDetector<'a>
impl<'a> Unpin for ModuleDetector<'a>
impl<'a> UnsafeUnpin for ModuleDetector<'a>
impl<'a> UnwindSafe for ModuleDetector<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more