pub struct SampleContext<'a> {
pub node: &'a GraphNode,
pub neighbors: Vec<NeighborRef<'a>>,
pub content: Option<&'a str>,
pub annotations: &'a HashMap<String, Value>,
pub graph_metadata: &'a HashMap<String, String>,
}Expand description
Local context provided to a Sampler during computation.
Gathers everything known about a single node at the time of sampling: structural position, optional content, previously-computed annotations, and the edges connecting it to its neighbors.
Fields§
§node: &'a GraphNodeThe node being sampled.
neighbors: Vec<NeighborRef<'a>>Direct neighbors (both incoming and outgoing edges resolved to nodes).
content: Option<&'a str>Source file content, when available and requested.
annotations: &'a HashMap<String, Value>Previously-computed artifacts attached to this node (keyed by sampler id). Enables sampler composition: earlier samplers deposit artifacts that later samplers can read.
graph_metadata: &'a HashMap<String, String>Graph-level metadata (project name, workspace root, etc.).
Trait Implementations§
Source§impl<'a> Clone for SampleContext<'a>
impl<'a> Clone for SampleContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for SampleContext<'a>
impl<'a> RefUnwindSafe for SampleContext<'a>
impl<'a> Send for SampleContext<'a>
impl<'a> Sync for SampleContext<'a>
impl<'a> Unpin for SampleContext<'a>
impl<'a> UnsafeUnpin for SampleContext<'a>
impl<'a> UnwindSafe for SampleContext<'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