pub struct SimilaritySessionNode { /* private fields */ }Expand description
The main unit of similarity processing.
Implementations§
Source§impl SimilaritySessionNode
impl SimilaritySessionNode
Sourcepub fn new(view: &BinaryView) -> Ref<Self>
pub fn new(view: &BinaryView) -> Ref<Self>
Creates a node for an open view and schedules its functions.
Sourcepub fn new_from_file(file: &FileMetadata) -> Ref<Self>
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.
pub unsafe fn from_raw(handle: *mut BNSimilaritySessionNode) -> Self
pub unsafe fn ref_from_raw(handle: *mut BNSimilaritySessionNode) -> Ref<Self>
Sourcepub fn view(&self) -> Option<Ref<BinaryView>>
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.
Sourcepub fn set_view(&self, view: Option<&BinaryView>)
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.
Sourcepub fn file(&self) -> Ref<FileMetadata>
pub fn file(&self) -> Ref<FileMetadata>
Returns the file used by the node.
Sourcepub fn load_options(&self) -> Ref<Settings>
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.
Sourcepub fn id(&self) -> SimilaritySessionNodeId
pub fn id(&self) -> SimilaritySessionNodeId
Returns the node’s ID.
Sourcepub fn create_entity(&self, info: SimilarityEntityInfo) -> SimilarityEntityId
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.
Sourcepub fn remove_entity(&self, id: SimilarityEntityId) -> bool
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.
Sourcepub fn entity(&self, id: SimilarityEntityId) -> Option<SimilarityEntityInfo>
pub fn entity(&self, id: SimilarityEntityId) -> Option<SimilarityEntityInfo>
Returns information about an entity.
Sourcepub fn entities(&self) -> Array<SimilarityEntityId>
pub fn entities(&self) -> Array<SimilarityEntityId>
Returns all entities in the node, including entities used only as match targets.
Sourcepub fn add_scheduled_entity(&self, id: SimilarityEntityId) -> bool
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.
Sourcepub fn remove_scheduled_entity(&self, id: SimilarityEntityId) -> bool
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.
Sourcepub fn scheduled_entities(&self) -> Array<SimilarityEntityId>
pub fn scheduled_entities(&self) -> Array<SimilarityEntityId>
Returns the entities waiting for provider processing.
Sourcepub fn entity_function(&self, id: SimilarityEntityId) -> Option<Ref<Function>>
pub fn entity_function(&self, id: SimilarityEntityId) -> Option<Ref<Function>>
Returns the function represented by an entity, if it is available.
Sourcepub fn results(&self, entity: SimilarityEntityId) -> Vec<SimilarityResultId>
pub fn results(&self, entity: SimilarityEntityId) -> Vec<SimilarityResultId>
Returns the result IDs for an entity.
Sourcepub fn result(&self, result: SimilarityResultId) -> Option<SimilarityResult>
pub fn result(&self, result: SimilarityResultId) -> Option<SimilarityResult>
Returns a stored result by its ID, which is unique within the node.
Sourcepub fn apply_target(
&self,
entity: SimilarityEntityId,
target: SimilarityEntityRef,
) -> SimilarityApplyStatus
pub fn apply_target( &self, entity: SimilarityEntityId, target: SimilarityEntityRef, ) -> SimilarityApplyStatus
Applies the standard metadata transfer from a target entity.
Sourcepub fn set_resolved_result(
&self,
entity: SimilarityEntityId,
result: SimilarityResultId,
) -> bool
pub fn set_resolved_result( &self, entity: SimilarityEntityId, result: SimilarityResultId, ) -> bool
Selects a provider result for an entity.
Sourcepub fn resolved_result(
&self,
entity: SimilarityEntityId,
) -> Option<SimilarityResultId>
pub fn resolved_result( &self, entity: SimilarityEntityId, ) -> Option<SimilarityResultId>
Returns the selected result for an entity.
Sourcepub fn clear_resolved_result(&self, entity: SimilarityEntityId) -> bool
pub fn clear_resolved_result(&self, entity: SimilarityEntityId) -> bool
Clears the selected result for an entity.
Sourcepub fn incoming_edges(&self) -> Vec<SimilaritySessionNodeId>
pub fn incoming_edges(&self) -> Vec<SimilaritySessionNodeId>
Returns the IDs of nodes with edges into this node, in ascending order.
Sourcepub fn outgoing_edges(&self) -> Vec<SimilaritySessionNodeId>
pub fn outgoing_edges(&self) -> Vec<SimilaritySessionNodeId>
Returns the IDs of nodes with edges out of this node, in ascending order.
Sourcepub fn incoming_nodes(&self) -> Array<SimilaritySessionNode>
pub fn incoming_nodes(&self) -> Array<SimilaritySessionNode>
Returns nodes with edges into this node, ordered by ID.
Sourcepub fn outgoing_nodes(&self) -> Array<SimilaritySessionNode>
pub fn outgoing_nodes(&self) -> Array<SimilaritySessionNode>
Returns nodes with edges out of this node, ordered by ID.
Trait Implementations§
Source§impl ToOwned for SimilaritySessionNode
impl ToOwned for SimilaritySessionNode
Source§type Owned = Ref<SimilaritySessionNode>
type Owned = Ref<SimilaritySessionNode>
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 SimilaritySessionNode
impl RefUnwindSafe for SimilaritySessionNode
impl !Send for SimilaritySessionNode
impl !Sync for SimilaritySessionNode
impl Unpin for SimilaritySessionNode
impl UnsafeUnpin for SimilaritySessionNode
impl UnwindSafe for SimilaritySessionNode
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