Skip to main content

SimilaritySessionNode

Struct SimilaritySessionNode 

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

The main unit of similarity processing.

Implementations§

Source§

impl SimilaritySessionNode

Source

pub fn new(view: &BinaryView) -> Ref<Self>

Creates a node for an open view and schedules its functions.

Source

pub fn new_from_file(file: &FileMetadata) -> Ref<Self>

Creates a node that opens its view and schedules its functions when run.

The session closes the view when the run no longer needs it, so the view may be unavailable at other times.

Source

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

Source

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

Source

pub fn view(&self) -> Option<Ref<BinaryView>>

Returns the node’s open view if one is available.

If the node was created with SimilaritySessionNode::new_from_file, its view may be unavailable outside a session run. The session closes the view when the run no longer needs it.

Source

pub fn set_view(&self, view: Option<&BinaryView>)

Replaces the node’s view and creates entities for its functions.

A view backed by a different FileMetadata is ignored. Do not mix files.

Source

pub fn file(&self) -> Ref<FileMetadata>

Returns the file used by the node.

Source

pub fn load_options(&self) -> Ref<Settings>

Returns the settings used when this node opens its view.

Modify the returned settings before running the session.

Source

pub fn id(&self) -> SimilaritySessionNodeId

Returns the node’s ID.

Source

pub fn create_entity(&self, info: SimilarityEntityInfo) -> SimilarityEntityId

Adds an entity without scheduling it.

An existing entity with the same type and address is reused. A non-empty name refreshes its display name.

Source

pub fn remove_entity(&self, id: SimilarityEntityId) -> bool

Removes an entity, its schedule, its provider results, and its selected result.

If you are looking to unschedule an entity, use SimilaritySessionNode::remove_scheduled_entity.

Source

pub fn entity(&self, id: SimilarityEntityId) -> Option<SimilarityEntityInfo>

Returns information about an entity.

Source

pub fn entities(&self) -> Array<SimilarityEntityId>

Returns all entities in the node, including entities used only as match targets.

Source

pub fn add_scheduled_entity(&self, id: SimilarityEntityId) -> bool

Schedules an entity for the next provider round.

The session consumes each scheduled batch before resolution. Resolvers can schedule an entity again to request another round.

New nodes schedule all available entities, so this is mainly needed for entities added later.

Source

pub fn remove_scheduled_entity(&self, id: SimilarityEntityId) -> bool

Unschedules an entity without removing it from the node.

If you are looking to remove an entity, use SimilaritySessionNode::remove_entity.

Source

pub fn scheduled_entities(&self) -> Array<SimilarityEntityId>

Returns the entities waiting for provider processing.

Source

pub fn entity_function(&self, id: SimilarityEntityId) -> Option<Ref<Function>>

Returns the function represented by an entity, if it is available.

Source

pub fn results(&self, entity: SimilarityEntityId) -> Vec<SimilarityResultId>

Returns the result IDs for an entity.

Source

pub fn result(&self, result: SimilarityResultId) -> Option<SimilarityResult>

Returns a stored result by its ID, which is unique within the node.

Source

pub fn apply_target( &self, entity: SimilarityEntityId, target: SimilarityEntityRef, ) -> SimilarityApplyStatus

Applies the standard metadata transfer from a target entity.

Source

pub fn set_resolved_result( &self, entity: SimilarityEntityId, result: SimilarityResultId, ) -> bool

Selects a provider result for an entity.

Source

pub fn resolved_result( &self, entity: SimilarityEntityId, ) -> Option<SimilarityResultId>

Returns the selected result for an entity.

Source

pub fn clear_resolved_result(&self, entity: SimilarityEntityId) -> bool

Clears the selected result for an entity.

Source

pub fn incoming_edges(&self) -> Vec<SimilaritySessionNodeId>

Returns the IDs of nodes with edges into this node, in ascending order.

Source

pub fn outgoing_edges(&self) -> Vec<SimilaritySessionNodeId>

Returns the IDs of nodes with edges out of this node, in ascending order.

Source

pub fn incoming_nodes(&self) -> Array<SimilaritySessionNode>

Returns nodes with edges into this node, ordered by ID.

Source

pub fn outgoing_nodes(&self) -> Array<SimilaritySessionNode>

Returns nodes with edges out of this node, ordered by ID.

Trait Implementations§

Source§

impl CoreArrayProvider for SimilaritySessionNode

Source§

impl ToOwned for SimilaritySessionNode

Source§

type Owned = Ref<SimilaritySessionNode>

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