[−][src]Enum wikibase::Entity
Entiry is an enum wrapper around items, properties, and potentially others (lexemes?)
Variants
Item(ItemEntity)
Property(PropertyEntity)
Methods
impl Entity
[src]
pub fn new_empty_item() -> Self
[src]
pub fn new_empty_property() -> Self
[src]
pub fn new_item(
id: String,
labels: Vec<LocaleString>,
descriptions: Vec<LocaleString>,
aliases: Vec<LocaleString>,
claims: Vec<Statement>,
sitelinks: Option<Vec<SiteLink>>,
missing: bool
) -> Self
[src]
id: String,
labels: Vec<LocaleString>,
descriptions: Vec<LocaleString>,
aliases: Vec<LocaleString>,
claims: Vec<Statement>,
sitelinks: Option<Vec<SiteLink>>,
missing: bool
) -> Self
pub fn new_property(
id: String,
labels: Vec<LocaleString>,
descriptions: Vec<LocaleString>,
aliases: Vec<LocaleString>,
claims: Vec<Statement>,
sitelinks: Option<Vec<SiteLink>>,
missing: bool
) -> Self
[src]
id: String,
labels: Vec<LocaleString>,
descriptions: Vec<LocaleString>,
aliases: Vec<LocaleString>,
claims: Vec<Statement>,
sitelinks: Option<Vec<SiteLink>>,
missing: bool
) -> Self
pub fn new_from_id<S: Into<String>>(
id: S,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]
id: S,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
Takes a single Q-Id or P-Id and returns an item result.
Example
let configuration = wikibase::Configuration::new("Automatic-Testing/1.0").unwrap(); let item = wikibase::Entity::new_from_id("Q47532594", &configuration);
pub fn new_from_ids(
ids: Vec<String>,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]
ids: Vec<String>,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
Takes a vector of Q-Ids or P-Ids and returns an item result.
pub fn new_from_query(
query: &EntityQuery,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]
query: &EntityQuery,
configuration: &Configuration
) -> Result<Entity, WikibaseError>
Takes a entity query and returns an item.
pub fn aliases(&self) -> &Vec<LocaleString>
[src]
pub fn descriptions(&self) -> &Vec<LocaleString>
[src]
pub fn labels(&self) -> &Vec<LocaleString>
[src]
pub fn label_in_locale(&self, locale: &str) -> Option<&str>
[src]
pub fn description_in_locale(&self, locale: &str) -> Option<&str>
[src]
pub fn set_aliases(&mut self, aliases: Vec<LocaleString>)
[src]
pub fn set_claims(&mut self, claims: Vec<Statement>)
[src]
pub fn add_claim(&mut self, claim: Statement)
[src]
pub fn set_descriptions(&mut self, descriptions: Vec<LocaleString>)
[src]
pub fn set_id(&mut self, id: String)
[src]
pub fn set_labels(&mut self, labels: Vec<LocaleString>)
[src]
pub fn set_missing(&mut self, missing: bool)
[src]
pub fn set_sitelinks(&mut self, sitelinks: Option<Vec<SiteLink>>)
[src]
pub fn set_label(&mut self, new_label: LocaleString)
[src]
pub fn remove_label<S: Into<String>>(&mut self, language: S)
[src]
pub fn remove_description<S: Into<String>>(&mut self, language: S)
[src]
pub fn set_sitelink(&mut self, new_sitelink: SiteLink)
[src]
pub fn remove_sitelink<S: Into<String>>(&mut self, site: S)
[src]
pub fn set_description(&mut self, new_description: LocaleString)
[src]
pub fn add_alias(&mut self, new_alias: LocaleString)
[src]
pub fn remove_alias(&mut self, alias: LocaleString)
[src]
pub fn sitelinks(&self) -> &Option<Vec<SiteLink>>
[src]
pub fn claims(&self) -> &Vec<Statement>
[src]
pub fn claims_mut(&mut self) -> &mut Vec<Statement>
[src]
pub fn id(&self) -> &str
[src]
pub fn missing(&self) -> bool
[src]
pub fn claims_with_property<S: Into<String>>(
&self,
property_id: S
) -> Vec<&Statement>
[src]
&self,
property_id: S
) -> Vec<&Statement>
pub fn values_for_property<S: Into<String>>(&self, property_id: S) -> Vec<Value>
[src]
pub fn has_target_entity<S: Into<String>>(
&self,
property_id: S,
target_entity_id: S
) -> bool
[src]
&self,
property_id: S,
target_entity_id: S
) -> bool
pub fn claim_with_id<S: Into<String>>(&self, id: S) -> Option<&Statement>
[src]
pub fn has_claims_with_property<S: Into<String>>(&self, property_id: S) -> bool
[src]
pub fn entity_type(&self) -> &EntityType
[src]
Trait Implementations
impl Clone for Entity
[src]
fn clone(&self) -> Entity
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Entity
[src]
impl Serialize for Entity
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,