pub struct TraitImplBoundary { /* private fields */ }Expand description
A trait-impl-locality boundary: within a target crate, the named trait may be
implemented only inside the declared allowed module location(s). An
impl <Trait> for <Type> block outside them is a violation. Declared in Rust (the
single source of truth) and composed with the other dimensions at the gate. This
governs impl locality — the complement of exposure (SemanticBoundary) and of the
static import boundary. It governs only the target crate’s own impl sites; it makes no
claim about downstream crates (that would be external trait sealing, an essential gap).
Implementations§
Source§impl TraitImplBoundary
impl TraitImplBoundary
Sourcepub fn in_crate(package: &str) -> TraitImplCrateDraft
pub fn in_crate(package: &str) -> TraitImplCrateDraft
Begin a trait-impl-locality boundary in the crate named package.
Sourcepub fn crate_package(&self) -> &str
pub fn crate_package(&self) -> &str
The crate this boundary governs.
Sourcepub fn allowed_locations(&self) -> &[String]
pub fn allowed_locations(&self) -> &[String]
The allowed module-location prefixes where the trait MAY be implemented.
Sourcepub fn reason(&self) -> &str
pub fn reason(&self) -> &str
The human-readable reason recorded with the boundary (the repair hint).
Sourcepub fn with_anchor(self, anchor: &str) -> Self
pub fn with_anchor(self, anchor: &str) -> Self
Attach a durable governance anchor (e.g. "ADR-014") — a stable pointer into the
project’s governance, distinct from the free-text reason. Optional; a boundary with
none projects and reacts exactly as before.
Trait Implementations§
Source§impl Clone for TraitImplBoundary
impl Clone for TraitImplBoundary
Source§fn clone(&self) -> TraitImplBoundary
fn clone(&self) -> TraitImplBoundary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more