pub struct MaintainedCandidateStateProvider { /* private fields */ }Expand description
First-party provider maintaining named graph-derived candidate sets.
Implementations§
Source§impl MaintainedCandidateStateProvider
impl MaintainedCandidateStateProvider
Sourcepub fn new(
specs: impl IntoIterator<Item = CandidateStateSpec>,
) -> Result<Self, ProviderError>
pub fn new( specs: impl IntoIterator<Item = CandidateStateSpec>, ) -> Result<Self, ProviderError>
Construct an empty provider for specs.
§Errors
Returns ProviderError when two specs use the same name.
Sourcepub fn from_graph(
specs: impl IntoIterator<Item = CandidateStateSpec>,
graph: &SeleneGraph,
) -> Result<Self, ProviderError>
pub fn from_graph( specs: impl IntoIterator<Item = CandidateStateSpec>, graph: &SeleneGraph, ) -> Result<Self, ProviderError>
Construct a provider and initialize it from a graph snapshot.
§Errors
Returns ProviderError when specs are invalid or the graph snapshot is
internally inconsistent.
Sourcepub fn rebuild_from_graph(
&self,
graph: &SeleneGraph,
) -> Result<(), ProviderError>
pub fn rebuild_from_graph( &self, graph: &SeleneGraph, ) -> Result<(), ProviderError>
Rebuild all maintained state from graph.
This is the safe attachment path when a provider is registered against an already-populated graph instead of observing mutations from graph birth.
§Errors
Returns ProviderError if live row-to-id mappings are inconsistent.
Sourcepub fn spec(&self, name: &DbString) -> Option<&CandidateStateSpec>
pub fn spec(&self, name: &DbString) -> Option<&CandidateStateSpec>
Return the configured spec named name.
Sourcepub fn candidate_set(&self, name: &DbString) -> Option<VectorCandidateSet>
pub fn candidate_set(&self, name: &DbString) -> Option<VectorCandidateSet>
Return the current candidate set for name.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Return the provider generation watermark.
Sourcepub fn candidate_set_at_generation(
&self,
name: &DbString,
generation: u64,
) -> Result<Option<VectorCandidateSet>, ProviderError>
pub fn candidate_set_at_generation( &self, name: &DbString, generation: u64, ) -> Result<Option<VectorCandidateSet>, ProviderError>
Return the current candidate set for name if it matches generation.
§Errors
Returns ProviderError when this provider has not applied every
mutation through generation.
Sourcepub fn candidate_state_infos_at_generation(
&self,
generation: u64,
) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
pub fn candidate_state_infos_at_generation( &self, generation: u64, ) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
Return generation-checked metadata for every configured candidate set.
§Errors
Returns ProviderError when this provider has not applied every
mutation through generation.
Trait Implementations§
Source§impl IndexProvider for MaintainedCandidateStateProvider
impl IndexProvider for MaintainedCandidateStateProvider
Source§fn provider_tag(&self) -> ProviderTag
fn provider_tag(&self) -> ProviderTag
Source§fn read_section(
&self,
sub_tag: SubTag,
bytes: &[u8],
) -> Result<(), ProviderError>
fn read_section( &self, sub_tag: SubTag, bytes: &[u8], ) -> Result<(), ProviderError>
Source§fn write_section(&self, sub_tag: SubTag) -> Result<Vec<u8>, ProviderError>
fn write_section(&self, sub_tag: SubTag) -> Result<Vec<u8>, ProviderError>
Source§fn on_change(&self, change: &Change) -> Result<(), ProviderError>
fn on_change(&self, change: &Change) -> Result<(), ProviderError>
Source§fn handles_change_batches(&self) -> bool
fn handles_change_batches(&self) -> bool
Source§fn on_changes(&self, changes: &[Change]) -> Result<(), ProviderError>
fn on_changes(&self, changes: &[Change]) -> Result<(), ProviderError>
Source§fn rebuild_from_graph(&self, graph: &SeleneGraph) -> Result<(), ProviderError>
fn rebuild_from_graph(&self, graph: &SeleneGraph) -> Result<(), ProviderError>
Source§fn on_commit_applied(&self, generation: u64) -> Result<(), ProviderError>
fn on_commit_applied(&self, generation: u64) -> Result<(), ProviderError>
Source§fn vector_candidate_set(
&self,
name: &DbString,
generation: u64,
) -> Result<Option<VectorCandidateSet>, ProviderError>
fn vector_candidate_set( &self, name: &DbString, generation: u64, ) -> Result<Option<VectorCandidateSet>, ProviderError>
Source§fn vector_candidate_state_infos(
&self,
generation: u64,
) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
fn vector_candidate_state_infos( &self, generation: u64, ) -> Result<Vec<VectorCandidateStateInfo>, ProviderError>
generation. Read moreAuto Trait Implementations§
impl !Freeze for MaintainedCandidateStateProvider
impl !RefUnwindSafe for MaintainedCandidateStateProvider
impl Send for MaintainedCandidateStateProvider
impl Sync for MaintainedCandidateStateProvider
impl Unpin for MaintainedCandidateStateProvider
impl UnsafeUnpin for MaintainedCandidateStateProvider
impl UnwindSafe for MaintainedCandidateStateProvider
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.