pub struct RawEntity {
pub id: String,
pub entity_type: EntityType,
pub text: String,
pub span: (usize, usize),
pub file: String,
pub line: usize,
}Expand description
One extracted entity, anchored to a byte span and source line.
Fields§
§id: StringStable hash of (entity_type, text, file).
entity_type: EntityType§text: String§span: (usize, usize)§file: String§line: usizeImplementations§
Source§impl RawEntity
impl RawEntity
Sourcepub fn new(
entity_type: EntityType,
text: String,
span: (usize, usize),
file: &str,
line: usize,
) -> Self
pub fn new( entity_type: EntityType, text: String, span: (usize, usize), file: &str, line: usize, ) -> Self
Construct a RawEntity with a deterministic SHA-256 id derived from
(entity_type, text, file). Same inputs always yield the same id, so
re-extraction over identical source produces stable references for the
KG layer.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawEntity
impl<'de> Deserialize<'de> for RawEntity
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
Auto Trait Implementations§
impl Freeze for RawEntity
impl RefUnwindSafe for RawEntity
impl Send for RawEntity
impl Sync for RawEntity
impl Unpin for RawEntity
impl UnsafeUnpin for RawEntity
impl UnwindSafe for RawEntity
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