pub struct MetadataSampler { /* private fields */ }Expand description
A sampler that extracts metadata from nodes as-is, useful for exposing node properties (language, extension, has_tests) into the annotation pipeline without transformation.
Implementations§
Trait Implementations§
Source§impl Sampler for MetadataSampler
impl Sampler for MetadataSampler
Source§fn compute(
&self,
ctx: &SampleContext<'_>,
) -> Result<Option<Value>, SamplerError>
fn compute( &self, ctx: &SampleContext<'_>, ) -> Result<Option<Value>, SamplerError>
Compute the artifact for a single node.
Return
Ok(None) to skip a node without error.Source§fn selector(&self) -> NodeSelector
fn selector(&self) -> NodeSelector
Which nodes this sampler operates on.
Source§fn sample(
&self,
graph: &SourceCodeGraph,
annotations: &AnnotationMap,
) -> Result<SampleResult, SamplerError>
fn sample( &self, graph: &SourceCodeGraph, annotations: &AnnotationMap, ) -> Result<SampleResult, SamplerError>
Run the full sampling pass over a graph. Read more
Auto Trait Implementations§
impl Freeze for MetadataSampler
impl RefUnwindSafe for MetadataSampler
impl Send for MetadataSampler
impl Sync for MetadataSampler
impl Unpin for MetadataSampler
impl UnsafeUnpin for MetadataSampler
impl UnwindSafe for MetadataSampler
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