Skip to main content

SharedFindings

Struct SharedFindings 

Source
pub struct SharedFindings<L: Language> { /* private fields */ }
Expand description

Concurrent shared state between TD and BU pipelines.

Generic over L: Language so that BehavioralBreak<L> carries typed category data instead of stringly-typed labels.

Thread-safe: all fields use concurrent data structures. Wrapped in Arc for sharing between async tasks.

Implementations§

Source§

impl<L: Language> SharedFindings<L>

Source

pub fn new() -> Self

Create new shared state with an empty broadcast channel.

Source

pub fn insert_structural_break(&self, change: StructuralChange)

Insert a structural break found by TD.

Also broadcasts the qualified name to BU via the channel. If the broadcast fails (no receivers yet), that’s fine — BU will check the DashMap directly.

Source

pub fn insert_structural_breaks(&self, changes: Vec<StructuralChange>)

Insert multiple structural breaks (batch operation after diff_surfaces).

Source

pub fn set_old_surface(&self, surface: Arc<ApiSurface<L::SymbolData>>)

Set the old API surface (called by TD after extraction). Accepts an Arc so the caller can retain a cheap handle.

Source

pub fn set_new_surface(&self, surface: Arc<ApiSurface<L::SymbolData>>)

Set the new API surface (called by TD after extraction).

Source

pub fn subscribe_to_td(&self) -> BuReceiver

Subscribe to TD’s broadcast channel.

Call this once at the start of BU. Returns a BuReceiver that wraps the broadcast receiver and a local skip set for efficient repeated checks.

Source

pub fn has_structural_break(&self, qualified_name: &str) -> bool

Check if TD already found a structural break for this symbol.

This is the DashMap fallback — always accurate but doesn’t benefit from the broadcast channel’s real-time notifications.

Source

pub fn insert_behavioral_break(&self, brk: BehavioralBreak<L>)

Insert a behavioral break found by BU.

Source

pub fn structural_breaks(&self) -> &DashMap<String, StructuralChange>

Get all structural breaks (for merge step).

Source

pub fn behavioral_breaks(&self) -> &DashMap<String, BehavioralBreak<L>>

Get all behavioral breaks (for merge step).

Source

pub async fn get_old_surface(&self) -> &Arc<ApiSurface<L::SymbolData>>

Get the old API surface (blocks if TD hasn’t set it yet).

Source

pub async fn get_new_surface(&self) -> &Arc<ApiSurface<L::SymbolData>>

Get the new API surface (blocks if TD hasn’t set it yet).

Source

pub fn try_get_old_surface(&self) -> Option<&Arc<ApiSurface<L::SymbolData>>>

Try to get the old surface without blocking (returns None if not set yet). Returns a reference to the Arc — clone the Arc (cheap) if you need ownership, or borrow through it with &**arc.

Source

pub fn try_get_new_surface(&self) -> Option<&Arc<ApiSurface<L::SymbolData>>>

Try to get the new surface without blocking (returns None if not set yet).

Source

pub fn degradation(&self) -> &DegradationTracker

Access the degradation tracker to record or query non-fatal issues.

Available to all pipeline phases and Language implementations.

Source

pub fn degradation_arc(&self) -> Arc<DegradationTracker>

Get a clone of the Arc-wrapped degradation tracker.

Useful when you need to pass the tracker to a spawned task.

Source

pub fn structural_break_count(&self) -> usize

Count of structural breaks found so far.

Source

pub fn behavioral_break_count(&self) -> usize

Count of behavioral breaks found so far.

Source

pub fn structural_break_names(&self) -> Vec<String>

Get all structural break qualified names (for reconciliation).

Trait Implementations§

Source§

impl<L: Language> Default for SharedFindings<L>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more