pub struct MeasurementUnit {
pub custom_unit: Option<MeasurementUnitCustom>,
pub area_unit: Option<MeasurementUnitArea>,
pub length_unit: Option<MeasurementUnitLength>,
pub volume_unit: Option<MeasurementUnitVolume>,
pub weight_unit: Option<MeasurementUnitWeight>,
pub generic_unit: Option<MeasurementUnitGeneric>,
pub time_unit: Option<MeasurementUnitTime>,
pub type: Option<MeasurementUnitUnitType>,
}
Expand description
Represents a unit of measurement to use with a quantity, such as ounces or inches.
Exactly one of the following fields are required: custom_unit
, area_unit
, length_unit
,
volume_unit
, and weight_unit
.
Fields§
§custom_unit: Option<MeasurementUnitCustom>
A custom unit of measurement defined by the seller using the Point of Sale app or ad-hoc as an order line item.
area_unit: Option<MeasurementUnitArea>
Represents a standard area unit.
length_unit: Option<MeasurementUnitLength>
Represents a standard length unit.
volume_unit: Option<MeasurementUnitVolume>
Represents a standard volume unit.
weight_unit: Option<MeasurementUnitWeight>
Represents a standard unit of weight or mass.
generic_unit: Option<MeasurementUnitGeneric>
Reserved for API integrations that lack the ability to specify a real measurement unit.
time_unit: Option<MeasurementUnitTime>
Represents a standard unit of time.
type: Option<MeasurementUnitUnitType>
Represents the type of the measurement unit.
Trait Implementations§
Source§impl Clone for MeasurementUnit
impl Clone for MeasurementUnit
Source§fn clone(&self) -> MeasurementUnit
fn clone(&self) -> MeasurementUnit
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MeasurementUnit
impl Debug for MeasurementUnit
Source§impl Default for MeasurementUnit
impl Default for MeasurementUnit
Source§fn default() -> MeasurementUnit
fn default() -> MeasurementUnit
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MeasurementUnit
impl<'de> Deserialize<'de> for MeasurementUnit
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 MeasurementUnit
impl PartialEq for MeasurementUnit
Source§impl Serialize for MeasurementUnit
impl Serialize for MeasurementUnit
impl Eq for MeasurementUnit
impl StructuralPartialEq for MeasurementUnit
Auto Trait Implementations§
impl Freeze for MeasurementUnit
impl RefUnwindSafe for MeasurementUnit
impl Send for MeasurementUnit
impl Sync for MeasurementUnit
impl Unpin for MeasurementUnit
impl UnwindSafe for MeasurementUnit
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
Compare self to
key
and return true
if they are equal.