pub struct SemanticEntity {
pub id: String,
pub entity_type: EntityType,
pub bounds: BoundingBox,
pub content: String,
pub metadata: EntityMetadata,
pub relationships: Vec<EntityRelation>,
}Expand description
Enhanced semantic entity with relationships
Fields§
§id: StringUnique identifier for this entity
entity_type: EntityTypeType of entity
bounds: BoundingBoxGeometric bounds of the entity
content: StringText content of the entity (if applicable)
metadata: EntityMetadataAssociated metadata
relationships: Vec<EntityRelation>Relationships to other entities
Implementations§
Source§impl SemanticEntity
impl SemanticEntity
Sourcepub fn new(id: String, entity_type: EntityType, bounds: BoundingBox) -> Self
pub fn new(id: String, entity_type: EntityType, bounds: BoundingBox) -> Self
Create a new semantic entity
Sourcepub fn with_content(self, content: impl Into<String>) -> Self
pub fn with_content(self, content: impl Into<String>) -> Self
Set the content text for this entity
Sourcepub fn with_metadata(self, metadata: EntityMetadata) -> Self
pub fn with_metadata(self, metadata: EntityMetadata) -> Self
Add metadata to this entity
Sourcepub fn with_relationship(
self,
target_id: impl Into<String>,
relation_type: RelationType,
) -> Self
pub fn with_relationship( self, target_id: impl Into<String>, relation_type: RelationType, ) -> Self
Add a relationship to another entity
Sourcepub fn with_relationships(self, relationships: Vec<EntityRelation>) -> Self
pub fn with_relationships(self, relationships: Vec<EntityRelation>) -> Self
Add multiple relationships
Trait Implementations§
Source§impl Clone for SemanticEntity
impl Clone for SemanticEntity
Source§fn clone(&self) -> SemanticEntity
fn clone(&self) -> SemanticEntity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticEntity
impl Debug for SemanticEntity
Source§impl<'de> Deserialize<'de> for SemanticEntity
impl<'de> Deserialize<'de> for SemanticEntity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SemanticEntity
impl PartialEq for SemanticEntity
Source§impl Serialize for SemanticEntity
impl Serialize for SemanticEntity
impl StructuralPartialEq for SemanticEntity
Auto Trait Implementations§
impl Freeze for SemanticEntity
impl RefUnwindSafe for SemanticEntity
impl Send for SemanticEntity
impl Sync for SemanticEntity
impl Unpin for SemanticEntity
impl UnwindSafe for SemanticEntity
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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