pub struct SemanticOverlay {
pub type_cardinalities: BTreeMap<(String, String, String), f64>,
pub function_cardinalities: BTreeMap<(String, String, String, usize), f64>,
pub coupling: CouplingData,
}Expand description
Processed semantic overlay, ready for consumption by the compliance pipeline. Constructed from SemanticData.
Note: The backend-resolved enum cardinality uses max-variant cardinality (only intra-variant boolean soup is penalized), while the syn-based computation may differ. When the overlay is present, the backend values take precedence.
Fields§
§type_cardinalities: BTreeMap<(String, String, String), f64>(file, module_path, type_name) -> resolved cardinality_log2
function_cardinalities: BTreeMap<(String, String, String, usize), f64>(file, module_path, fn_name, line) -> resolved internal_state_cardinality_log2
coupling: CouplingDataCoupling density computed from call edges.
Implementations§
Source§impl SemanticOverlay
impl SemanticOverlay
Sourcepub fn from_data(data: &SemanticData) -> Self
pub fn from_data(data: &SemanticData) -> Self
Build a SemanticOverlay from raw SemanticData.
Sourcepub fn type_cardinality(
&self,
file: &str,
module_path: &str,
name: &str,
) -> Option<f64>
pub fn type_cardinality( &self, file: &str, module_path: &str, name: &str, ) -> Option<f64>
Look up resolved type cardinality.
Uses suffix matching on file path and relaxed module_path matching to handle mismatches between syn (relative paths, empty module_path) and the semantic analysis backend (workspace-relative paths, resolved module_path).
Trait Implementations§
Source§impl Clone for SemanticOverlay
impl Clone for SemanticOverlay
Source§fn clone(&self) -> SemanticOverlay
fn clone(&self) -> SemanticOverlay
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticOverlay
impl Debug for SemanticOverlay
Source§impl Default for SemanticOverlay
impl Default for SemanticOverlay
Source§fn default() -> SemanticOverlay
fn default() -> SemanticOverlay
Source§impl<'de> Deserialize<'de> for SemanticOverlay
impl<'de> Deserialize<'de> for SemanticOverlay
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SemanticOverlay
impl RefUnwindSafe for SemanticOverlay
impl Send for SemanticOverlay
impl Sync for SemanticOverlay
impl Unpin for SemanticOverlay
impl UnsafeUnpin for SemanticOverlay
impl UnwindSafe for SemanticOverlay
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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