pub struct ShippingMethod {
pub id: String,
pub name: Option<String>,
pub cost: f64,
pub regions: Vec<String>,
}Expand description
A shipping zone offered by a stall.
Fields§
§id: StringMerchant-defined shipping zone id (echoed back in customer orders).
name: Option<String>Human-readable name of the shipping zone.
cost: f64Base cost for this zone, in the stall’s currency.
regions: Vec<String>Regions covered by this zone.
Implementations§
Source§impl ShippingMethod
impl ShippingMethod
Sourcepub fn new<S>(id: S, cost: f64) -> Self
pub fn new<S>(id: S, cost: f64) -> Self
Create a shipping method with the given id and base cost.
Sourcepub fn to_shipping_cost(&self) -> ShippingCost
pub fn to_shipping_cost(&self) -> ShippingCost
Project to the per-product ShippingCost that references this zone.
Trait Implementations§
Source§impl Clone for ShippingMethod
impl Clone for ShippingMethod
Source§fn clone(&self) -> ShippingMethod
fn clone(&self) -> ShippingMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ShippingMethod
impl Debug for ShippingMethod
Source§impl<'de> Deserialize<'de> for ShippingMethod
impl<'de> Deserialize<'de> for ShippingMethod
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 ShippingMethod
impl PartialEq for ShippingMethod
Source§impl Serialize for ShippingMethod
impl Serialize for ShippingMethod
impl StructuralPartialEq for ShippingMethod
Auto Trait Implementations§
impl Freeze for ShippingMethod
impl RefUnwindSafe for ShippingMethod
impl Send for ShippingMethod
impl Sync for ShippingMethod
impl Unpin for ShippingMethod
impl UnsafeUnpin for ShippingMethod
impl UnwindSafe for ShippingMethod
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