[][src]Enum gcp_client::google::cloud::language::v1::entity::Type

#[repr(i32)]pub enum Type {
    Unknown,
    Person,
    Location,
    Organization,
    Event,
    WorkOfArt,
    ConsumerGood,
    Other,
    PhoneNumber,
    Address,
    Date,
    Number,
    Price,
}

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

Unknown

Person

Person

Location

Location

Organization

Organization

Event

Event

WorkOfArt

Artwork

ConsumerGood

Consumer product

Other

Other types of entities

PhoneNumber

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 convention
  • national_prefix – country code, if detected
  • area_code – region or area code, if detected
  • extension – phone extension (to be dialed after connection), if detected
Address

Address

The metadata identifies the street number and locality plus whichever additional elements appear in the text:

  • street_number – street number
  • locality – city or town
  • street_name – street/route name, if detected
  • postal_code – postal code, if detected
  • country – country, if detected
  • broad_region – administrative area, such as the state, if detected
  • narrow_region – smaller administrative area, such as county, if detected
  • sublocality – used in Asian addresses to demark a district within a city, if detected
Date

Date

The metadata identifies the components of the date:

  • year – four digit year, if detected
  • month – two digit month number, if detected
  • day – two digit day number, if detected
Number

Number

The metadata is the number itself.

Price

Price

The metadata identifies the value and currency.

Implementations

impl Type[src]

pub fn is_valid(value: i32) -> bool[src]

Returns true if value is a variant of Type.

pub fn from_i32(value: i32) -> Option<Type>[src]

Converts an i32 to a Type, or None if value is not a valid variant.

Trait Implementations

impl Clone for Type[src]

impl Copy for Type[src]

impl Debug for Type[src]

impl Default for Type[src]

impl Eq for Type[src]

impl From<Type> for i32[src]

impl Hash for Type[src]

impl Ord for Type[src]

impl PartialEq<Type> for Type[src]

impl PartialOrd<Type> for Type[src]

impl StructuralEq for Type[src]

impl StructuralPartialEq for Type[src]

Auto Trait Implementations

impl RefUnwindSafe for Type

impl Send for Type

impl Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]