#[repr(i32)]pub enum Type {
Show 13 variants
Unknown = 0,
Person = 1,
Location = 2,
Organization = 3,
Event = 4,
WorkOfArt = 5,
ConsumerGood = 6,
Other = 7,
PhoneNumber = 9,
Address = 10,
Date = 11,
Number = 12,
Price = 13,
}
Expand description
The type of the entity. For most entity types, the associated metadata is a
Wikipedia URL (wikipedia_url
) and Knowledge Graph MID (mid
). The table
below lists the associated fields for entities that have different
metadata.
Variants§
Unknown = 0
Unknown
Person = 1
Person
Location = 2
Location
Organization = 3
Organization
Event = 4
Event
WorkOfArt = 5
Artwork
ConsumerGood = 6
Consumer product
Other = 7
Other types of entities
PhoneNumber = 9
Phone number
The metadata lists the phone number, formatted according to local convention, plus whichever additional elements appear in the text:
number
- the actual number, broken down into sections as per local conventionnational_prefix
- country code, if detectedarea_code
- region or area code, if detectedextension
- phone extension (to be dialed after connection), if detected
Address = 10
Address
The metadata identifies the street number and locality plus whichever additional elements appear in the text:
street_number
- street numberlocality
- city or townstreet_name
- street/route name, if detectedpostal_code
- postal code, if detectedcountry
- country, if detected<broad_region
- administrative area, such as the state, if detectednarrow_region
- smaller administrative area, such as county, if detectedsublocality
- used in Asian addresses to demark a district within a city, if detected
Date = 11
Date
The metadata identifies the components of the date:
year
- four digit year, if detectedmonth
- two digit month number, if detectedday
- two digit day number, if detected
Number = 12
Number
The metadata is the number itself.
Price = 13
Price
The metadata identifies the value
and currency
.
Implementations§
source§impl Type
impl Type
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Ord for Type
impl Ord for Type
source§impl PartialEq for Type
impl PartialEq for Type
source§impl PartialOrd for Type
impl PartialOrd for Type
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for Type
impl TryFrom<i32> for Type
§type Error = DecodeError
type Error = DecodeError
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request