#[non_exhaustive]pub enum EntityViewport {
Business,
Legal,
Technical,
Academic,
Personal,
Political,
Media,
Historical,
General,
Custom(String),
}Expand description
Viewport context for multi-faceted entity representation.
§Research Background
The concept of “Entity Viewports” comes from the observation that real-world entities are not monolithic - they present different facets depending on context:
- “Marie Curie” in an Academic context: physicist, Nobel laureate
- “Marie Curie” in a Technical context: radioactivity researcher, X-ray pioneer
- “Marie Curie” in a Personal context: mother, immigrant, educator
- “Marie Curie” in a Medical context: founder of mobile X-ray units
Rather than collapsing all information into a single vector, the viewport model preserves these distinctions and enables “projection” at query time.
§Usage in RAG Systems
When answering “What were Curie’s scientific contributions?”, retrieve
facts from the Academic viewport. When answering “What was Curie’s
personal life like?”, retrieve from Personal.
§Example
use anno_core::{Entity, EntityType, EntityViewport};
let mut entity = Entity::new("Marie Curie", EntityType::Person, 0, 11, 0.9);
entity.viewport = Some(EntityViewport::Academic);
assert!(entity.viewport.as_ref().unwrap().is_professional());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Business
Business/financial context (CEO, revenue, market cap)
Legal
Legal context (lawsuits, settlements, compliance)
Technical
Technical/engineering context (patents, inventions, code)
Academic
Academic/research context (publications, citations, grants)
Personal
Personal/biographical context (family, hobbies, background)
Political
Political context (lobbying, donations, policy positions)
Media
Media/public relations context (interviews, statements, PR)
Historical
Historical context (past roles, timeline events)
General
Generic/unspecified context
Custom(String)
Custom viewport with a descriptive label
Implementations§
Trait Implementations§
Source§impl Clone for EntityViewport
impl Clone for EntityViewport
Source§fn clone(&self) -> EntityViewport
fn clone(&self) -> EntityViewport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntityViewport
impl Debug for EntityViewport
Source§impl Default for EntityViewport
impl Default for EntityViewport
Source§fn default() -> EntityViewport
fn default() -> EntityViewport
Source§impl<'de> Deserialize<'de> for EntityViewport
impl<'de> Deserialize<'de> for EntityViewport
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EntityViewport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EntityViewport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for EntityViewport
impl Display for EntityViewport
Source§impl FromStr for EntityViewport
impl FromStr for EntityViewport
Source§type Err = Infallible
type Err = Infallible
Source§fn from_str(s: &str) -> Result<EntityViewport, <EntityViewport as FromStr>::Err>
fn from_str(s: &str) -> Result<EntityViewport, <EntityViewport as FromStr>::Err>
s to return a value of this type. Read moreSource§impl Hash for EntityViewport
impl Hash for EntityViewport
Source§impl PartialEq for EntityViewport
impl PartialEq for EntityViewport
Source§impl Serialize for EntityViewport
impl Serialize for EntityViewport
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for EntityViewport
impl StructuralPartialEq for EntityViewport
Auto Trait Implementations§
impl Freeze for EntityViewport
impl RefUnwindSafe for EntityViewport
impl Send for EntityViewport
impl Sync for EntityViewport
impl Unpin for EntityViewport
impl UnsafeUnpin for EntityViewport
impl UnwindSafe for EntityViewport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.