[−][src]Struct wikibase::Snak
Snak
Each Snak has a property and a value (data_value
). Each claim has
one main snak and an arbitrary amount of snaks for qualifiers and
references.
Data type
- commonsMedia
- wikibase-item
Methods
impl Snak
[src]
Main snak data structure
The main snak is an object that contains the main statement information: the property, datatype and the value. The statement, qualifiers and references are the 3 snaks of a statement object.
pub fn new<S: Into<String>>(
datatype: SnakDataType,
property: S,
snak_type: SnakType,
data_value: Option<DataValue>
) -> Snak
[src]
datatype: SnakDataType,
property: S,
snak_type: SnakType,
data_value: Option<DataValue>
) -> Snak
pub fn new_time<S: Into<String>>(property: S, value: S, precision: u64) -> Snak
[src]
pub fn new_item<S: Into<String>>(property: S, entity_id: S) -> Snak
[src]
pub fn new_string<S: Into<String>>(property: S, value: S) -> Snak
[src]
pub fn new_external_id<S: Into<String>>(property: S, value: S) -> Snak
[src]
pub fn new_coordinate<S: Into<String>>(
property: S,
latitude: f64,
longitude: f64
) -> Snak
[src]
property: S,
latitude: f64,
longitude: f64
) -> Snak
pub fn new_monolingual_text<S: Into<String>>(
property: S,
language: S,
value: S
) -> Snak
[src]
property: S,
language: S,
value: S
) -> Snak
pub fn new_quantity<S: Into<String>>(property: S, amount: f64) -> Snak
[src]
pub fn new_no_value<S: Into<String>>(
property: S,
datatype: SnakDataType
) -> Snak
[src]
property: S,
datatype: SnakDataType
) -> Snak
pub fn new_unknown_value<S: Into<String>>(
property: S,
datatype: SnakDataType
) -> Snak
[src]
property: S,
datatype: SnakDataType
) -> Snak
pub fn datatype(&self) -> &SnakDataType
[src]
pub fn data_value(&self) -> &Option<DataValue>
[src]
pub fn property(&self) -> &str
[src]
pub fn set_datatype(&mut self, datatype: SnakDataType)
[src]
pub fn set_data_value(&mut self, data_value: Option<DataValue>)
[src]
pub fn set_property(&mut self, property: &str)
[src]
pub fn set_snak_type(&mut self, snak_type: SnakType)
[src]
pub fn snak_type(&self) -> &SnakType
[src]
Trait Implementations
impl PartialEq<Snak> for Snak
[src]
impl Clone for Snak
[src]
fn clone(&self) -> Snak
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Snak
[src]
impl Serialize for Snak
[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>,