pub struct SimilaritySession { /* private fields */ }Expand description
Coordinates providers and resolvers across a graph of binaries.
Implementations§
Source§impl SimilaritySession
impl SimilaritySession
pub unsafe fn from_raw(handle: *mut BNSimilaritySession) -> Self
pub unsafe fn ref_from_raw(handle: *mut BNSimilaritySession) -> Ref<Self>
Sourcepub fn id(&self) -> SimilaritySessionId
pub fn id(&self) -> SimilaritySessionId
Returns the session’s unique ID.
Sourcepub fn add_provider(&self, provider: &CoreSimilarityProvider)
pub fn add_provider(&self, provider: &CoreSimilarityProvider)
Adds a provider and schedules entities processed by earlier runs for the next run.
NOTE: Ignored while a run is active.
Sourcepub fn remove_provider(&self, provider: &CoreSimilarityProvider)
pub fn remove_provider(&self, provider: &CoreSimilarityProvider)
Removes a provider, clears its results, and marks affected entities for resolution.
NOTE: Ignored while a run is active.
Sourcepub fn update_provider_settings(
&self,
provider: &CoreSimilarityProvider,
settings: &Settings,
) -> bool
pub fn update_provider_settings( &self, provider: &CoreSimilarityProvider, settings: &Settings, ) -> bool
Updates a provider already in the session and schedules previously processed entities again.
Returns false during a run, when the provider is absent, or when it rejects the settings.
Sourcepub fn provider(
&self,
id: SimilarityProviderId,
) -> Option<Ref<CoreSimilarityProvider>>
pub fn provider( &self, id: SimilarityProviderId, ) -> Option<Ref<CoreSimilarityProvider>>
Returns a provider by ID.
Sourcepub fn providers(&self) -> Array<CoreSimilarityProvider>
pub fn providers(&self) -> Array<CoreSimilarityProvider>
Returns the session’s providers.
Sourcepub fn add_resolver(&self, resolver: &CoreSimilaritySessionResolver) -> bool
pub fn add_resolver(&self, resolver: &CoreSimilaritySessionResolver) -> bool
Adds a resolver created for this session and marks entities processed by earlier runs for resolution.
NOTE: Returns false during a run, for a duplicate, or for a resolver created for another session.
Sourcepub fn remove_resolver(&self, resolver: &CoreSimilaritySessionResolver) -> bool
pub fn remove_resolver(&self, resolver: &CoreSimilaritySessionResolver) -> bool
Removes a resolver from the session.
NOTE: Returns false during a run, or if it is absent or belongs to another session.
Sourcepub fn update_resolver_settings(
&self,
resolver: &CoreSimilaritySessionResolver,
settings: &Settings,
) -> bool
pub fn update_resolver_settings( &self, resolver: &CoreSimilaritySessionResolver, settings: &Settings, ) -> bool
Updates a resolver already in the session and marks previously processed entities for resolution.
Returns false during a run, when the resolver is absent or belongs to another session, or when it rejects the
settings.
Sourcepub fn resolver(
&self,
id: SimilaritySessionResolverId,
) -> Option<Ref<CoreSimilaritySessionResolver>>
pub fn resolver( &self, id: SimilaritySessionResolverId, ) -> Option<Ref<CoreSimilaritySessionResolver>>
Returns a resolver by ID.
Sourcepub fn resolvers(&self) -> Array<CoreSimilaritySessionResolver>
pub fn resolvers(&self) -> Array<CoreSimilaritySessionResolver>
Returns the session’s resolvers.
Sourcepub fn add_receiver(&self, receiver: &CoreSimilaritySessionReceiver)
pub fn add_receiver(&self, receiver: &CoreSimilaritySessionReceiver)
Adds an update receiver.
A running session keeps using the receiver list it started with.
Sourcepub fn remove_receiver(&self, receiver: &CoreSimilaritySessionReceiver)
pub fn remove_receiver(&self, receiver: &CoreSimilaritySessionReceiver)
Removes an update receiver.
A running session keeps using the receiver list it started with.
Sourcepub fn receivers(&self) -> Array<CoreSimilaritySessionReceiver>
pub fn receivers(&self) -> Array<CoreSimilaritySessionReceiver>
Returns the session’s update receivers.
Sourcepub fn graph(&self) -> Ref<SimilaritySessionGraph>
pub fn graph(&self) -> Ref<SimilaritySessionGraph>
Returns the session graph.
Sourcepub fn run(&self) -> Ref<SimilaritySessionCompletion>
pub fn run(&self) -> Ref<SimilaritySessionCompletion>
Starts a background run with the current graph, providers, and resolvers.
Changes to them are ignored until the run finishes.
NOTE: Returns the completion state of the active run when already running.
Trait Implementations§
Source§impl ToOwned for SimilaritySession
impl ToOwned for SimilaritySession
Source§type Owned = Ref<SimilaritySession>
type Owned = Ref<SimilaritySession>
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Auto Trait Implementations§
impl Freeze for SimilaritySession
impl RefUnwindSafe for SimilaritySession
impl !Send for SimilaritySession
impl !Sync for SimilaritySession
impl Unpin for SimilaritySession
impl UnsafeUnpin for SimilaritySession
impl UnwindSafe for SimilaritySession
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more