pub struct ScoreScratch { /* private fields */ }Expand description
Reusable buffers for lexical_score_with.
Scoring one symbol needs a lowercased name, a lowercased signature, and the
identifier tokens of the name and container. Allocating those per symbol
dominated context_pack on large trees (one scan touches every symbol in
the repository), so the buffers are hoisted into a struct the caller keeps
across the whole scan. The values computed are identical to the naive
version; only the allocations are amortized.
The path and name buffers are separate on purpose. Sharing one would work
today — path_term_bonus returns its result before a name overwrites the
buffer — but it would break silently if a caller ever interleaved the two.
Trait Implementations§
Source§impl Default for ScoreScratch
impl Default for ScoreScratch
Source§fn default() -> ScoreScratch
fn default() -> ScoreScratch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScoreScratch
impl RefUnwindSafe for ScoreScratch
impl Send for ScoreScratch
impl Sync for ScoreScratch
impl Unpin for ScoreScratch
impl UnsafeUnpin for ScoreScratch
impl UnwindSafe for ScoreScratch
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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