Skip to main content

SimilaritySession

Struct SimilaritySession 

Source
pub struct SimilaritySession { /* private fields */ }
Expand description

Coordinates providers and resolvers across a graph of binaries.

Implementations§

Source§

impl SimilaritySession

Source

pub fn new() -> Ref<Self>

Creates an empty session.

Source

pub unsafe fn from_raw(handle: *mut BNSimilaritySession) -> Self

Source

pub unsafe fn ref_from_raw(handle: *mut BNSimilaritySession) -> Ref<Self>

Source

pub fn id(&self) -> SimilaritySessionId

Returns the session’s unique ID.

Source

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.

Source

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.

Source

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.

Source

pub fn provider( &self, id: SimilarityProviderId, ) -> Option<Ref<CoreSimilarityProvider>>

Returns a provider by ID.

Source

pub fn providers(&self) -> Array<CoreSimilarityProvider>

Returns the session’s providers.

Source

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.

Source

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.

Source

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.

Source

pub fn resolver( &self, id: SimilaritySessionResolverId, ) -> Option<Ref<CoreSimilaritySessionResolver>>

Returns a resolver by ID.

Source

pub fn resolvers(&self) -> Array<CoreSimilaritySessionResolver>

Returns the session’s resolvers.

Source

pub fn add_receiver(&self, receiver: &CoreSimilaritySessionReceiver)

Adds an update receiver.

A running session keeps using the receiver list it started with.

Source

pub fn remove_receiver(&self, receiver: &CoreSimilaritySessionReceiver)

Removes an update receiver.

A running session keeps using the receiver list it started with.

Source

pub fn receivers(&self) -> Array<CoreSimilaritySessionReceiver>

Returns the session’s update receivers.

Source

pub fn graph(&self) -> Ref<SimilaritySessionGraph>

Returns the session graph.

Source

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

Source§

type Owned = Ref<SimilaritySession>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more