pub struct ExtractedEntity {
pub local_id: String,
pub kind: String,
pub label: String,
pub confidence: Confidence,
pub stable_id: Option<EntityId>,
pub aliases: Vec<String>,
pub attributes: BTreeMap<String, String>,
pub hints: Vec<EntityHint>,
pub span: Option<TextSpan>,
}Fields§
§local_id: String§kind: String§label: String§confidence: Confidence§stable_id: Option<EntityId>§aliases: Vec<String>§attributes: BTreeMap<String, String>§hints: Vec<EntityHint>§span: Option<TextSpan>Implementations§
Source§impl ExtractedEntity
impl ExtractedEntity
Sourcepub fn new(
local_id: impl Into<String>,
kind: impl Into<String>,
label: impl Into<String>,
confidence: Confidence,
) -> Result<Self>
pub fn new( local_id: impl Into<String>, kind: impl Into<String>, label: impl Into<String>, confidence: Confidence, ) -> Result<Self>
Creates a provider-local entity mention.
§Errors
Rejects invalid local identifier, kind, or label text.
pub fn with_stable_id(self, id: EntityId) -> Self
pub fn with_alias(self, alias: impl Into<String>) -> Self
pub fn with_attribute( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn with_hint(self, hint: EntityHint) -> Self
pub const fn with_span(self, span: TextSpan) -> Self
Trait Implementations§
Source§impl Clone for ExtractedEntity
impl Clone for ExtractedEntity
Source§fn clone(&self) -> ExtractedEntity
fn clone(&self) -> ExtractedEntity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExtractedEntity
impl Debug for ExtractedEntity
Source§impl<'de> Deserialize<'de> for ExtractedEntity
impl<'de> Deserialize<'de> for ExtractedEntity
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
impl Eq for ExtractedEntity
Source§impl PartialEq for ExtractedEntity
impl PartialEq for ExtractedEntity
Source§impl Serialize for ExtractedEntity
impl Serialize for ExtractedEntity
impl StructuralPartialEq for ExtractedEntity
Auto Trait Implementations§
impl Freeze for ExtractedEntity
impl RefUnwindSafe for ExtractedEntity
impl Send for ExtractedEntity
impl Sync for ExtractedEntity
impl Unpin for ExtractedEntity
impl UnsafeUnpin for ExtractedEntity
impl UnwindSafe for ExtractedEntity
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