Struct nostr_sdk::nips::nip15::ShippingMethod
source · pub struct ShippingMethod {
pub id: String,
pub name: Option<String>,
pub cost: f64,
pub regions: Vec<String>,
}
Expand description
A shipping method as defined by the merchant
Fields§
§id: String
Shipping method unique id by merchant
name: Option<String>
Shipping method name
cost: f64
Shipping method cost (currency is the same as the stall)
regions: Vec<String>
Covered regions
Implementations§
source§impl ShippingMethod
impl ShippingMethod
sourcepub fn new<S>(id: S, cost: f64) -> ShippingMethod
pub fn new<S>(id: S, cost: f64) -> ShippingMethod
Create a new shipping method
sourcepub fn name<S>(self, name: S) -> ShippingMethod
pub fn name<S>(self, name: S) -> ShippingMethod
Set the name of the shipping method
sourcepub fn regions(self, regions: Vec<String>) -> ShippingMethod
pub fn regions(self, regions: Vec<String>) -> ShippingMethod
Add a region to the shipping method
sourcepub fn get_shipping_cost(&self) -> ShippingCost
pub fn get_shipping_cost(&self) -> ShippingCost
Get the product shipping cost of the shipping method
Trait Implementations§
source§impl Clone for ShippingMethod
impl Clone for ShippingMethod
source§fn clone(&self) -> ShippingMethod
fn clone(&self) -> ShippingMethod
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 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<ShippingMethod, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ShippingMethod, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for ShippingMethod
impl Serialize for ShippingMethod
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ShippingMethod
impl Send for ShippingMethod
impl Sync for ShippingMethod
impl Unpin 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