Skip to main content

Candidate

Struct Candidate 

Source
pub struct Candidate {
    pub id: u64,
    pub tree: PatchTree,
    pub features: Features,
    pub phi_std: Vec<f64>,
    pub key: String,
    pub render: Option<Arc<Audition>>,
    pub origin: Origin,
    pub name: Option<String>,
    pub pinned: bool,
}
Expand description

A vetted pool member.

Fields§

§id: u64

Stable id (unique for the lifetime of the engine; survives pool reordering and eviction of other members).

§tree: PatchTree

The term.

§features: Features

Its extracted features.

§phi_std: Vec<f64>

Standardized feature vector (empty until the standardizer exists).

§key: String

Content address of this candidate’s (term, spec) featurization. Carried rather than recomputed because hashing the term is the one thing every cache path needs and the term never changes.

§render: Option<Arc<Audition>>

The audition buffer, when resident. Governed by SessionConfig::render_policy — under RenderPolicy::Lazy this is None until Engine::render_of materializes it, and may go back to None when a newer audition evicts it. Never a signal that the candidate is unplayable; ask Engine::render_of for that.

Shared with the memo (and with whoever last asked for it) through an Arc — one allocation per audition, however many holders it has.

§origin: Origin

Provenance.

§name: Option<String>

User-given name (frontends fall back to tree.signature()).

§pinned: bool

The user asked to keep this one: Engine::insert_candidate will never evict it.

Deliberately not derived from the star rating. A star is an observation that enters the log and moves θ; if a rating also decided what survives, users would rate strategically to protect patches, and every protective over-rating is a preference they never held — under exactly the pressure where they care most. So the two channels stay separate: stars are what you think, pins are what you keep.

Capped by Engine::pin_cap; see there for why the pool cannot be pinned solid.

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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,