Struct rust_woocommerce::shipping_methods::ShippingMethod
source · pub struct ShippingMethod {
pub id: String,
pub title: String,
pub description: String,
}Expand description
#[cfg(test)]
mod tests {
use crate::{shipping_methods::ShippingMethod, ApiClient, Entity};
#[tokio::test]
async fn test_list_all_retrieve_shipping_methods() {
let client = ApiClient::from_env().unwrap();
let result = client
.list_all::<ShippingMethod>(Entity::ShippingMethod)
.await
.unwrap();
assert!(!result.is_empty());
let first = result.first().unwrap();
let retrieved = client
.retrieve::<ShippingMethod>(Entity::ShippingMethod, &first.id)
.await
.unwrap();
assert_eq!(first.title, retrieved.title);
}
}Fields§
§id: StringMethod ID.
title: StringShipping method title.
description: StringShipping method description.
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<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
Auto Trait Implementations§
impl Freeze for ShippingMethod
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