Struct square_api_client::models::MeasurementUnit
source · [−]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
sourceimpl Clone for MeasurementUnit
impl Clone for MeasurementUnit
sourcefn clone(&self) -> MeasurementUnit
fn clone(&self) -> MeasurementUnit
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MeasurementUnit
impl Debug for MeasurementUnit
sourceimpl Default for MeasurementUnit
impl Default for MeasurementUnit
sourcefn default() -> MeasurementUnit
fn default() -> MeasurementUnit
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for MeasurementUnit
impl<'de> Deserialize<'de> for MeasurementUnit
sourcefn 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
sourceimpl PartialEq<MeasurementUnit> for MeasurementUnit
impl PartialEq<MeasurementUnit> for MeasurementUnit
sourcefn eq(&self, other: &MeasurementUnit) -> bool
fn eq(&self, other: &MeasurementUnit) -> bool
sourceimpl Serialize for MeasurementUnit
impl Serialize for MeasurementUnit
impl Eq for MeasurementUnit
impl StructuralEq for MeasurementUnit
impl StructuralPartialEq for MeasurementUnit
Auto Trait Implementations
impl RefUnwindSafe for MeasurementUnit
impl Send for MeasurementUnit
impl Sync for MeasurementUnit
impl Unpin for MeasurementUnit
impl UnwindSafe for MeasurementUnit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.