Struct wikibase::value::QuantityValue
source · pub struct QuantityValue { /* private fields */ }Expand description
QuantityValue
Holds the quantity value of a claim.
§Json mapping
unit = http://www.wikidata.org/entity/Q11574
Implementations§
source§impl QuantityValue
impl QuantityValue
pub fn new_from_object( value: &Map<String, Value>, ) -> Result<QuantityValue, WikibaseError>
pub fn new<S: Into<String>>( amount: f64, lower_bound: Option<f64>, unit: S, upper_bound: Option<f64>, ) -> QuantityValue
pub fn amount(&self) -> &f64
pub fn lower_bound(&self) -> &Option<f64>
pub fn set_amount(&mut self, amount: f64)
pub fn set_lower_bound(&mut self, lower_bound: Option<f64>)
pub fn set_unit<S: Into<String>>(&mut self, unit: S)
pub fn set_upper_bound(&mut self, upper_bound: Option<f64>)
pub fn unit(&self) -> &str
pub fn upper_bound(&self) -> &Option<f64>
Trait Implementations§
source§impl Clone for QuantityValue
impl Clone for QuantityValue
source§fn clone(&self) -> QuantityValue
fn clone(&self) -> QuantityValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for QuantityValue
impl Debug for QuantityValue
source§impl<'de> Deserialize<'de> for QuantityValue
impl<'de> Deserialize<'de> for QuantityValue
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for QuantityValue
impl PartialEq for QuantityValue
source§fn eq(&self, other: &QuantityValue) -> bool
fn eq(&self, other: &QuantityValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for QuantityValue
impl Serialize for QuantityValue
impl StructuralPartialEq for QuantityValue
Auto Trait Implementations§
impl Freeze for QuantityValue
impl RefUnwindSafe for QuantityValue
impl Send for QuantityValue
impl Sync for QuantityValue
impl Unpin for QuantityValue
impl UnwindSafe for QuantityValue
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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 more