pub struct Value {
pub no_shipping: Option<bool>,
pub flat_rate: Option<Price>,
pub price_percentage: Option<String>,
pub carrier_rate: Option<String>,
pub subtable: Option<String>,
}
Expand description
The single value of a rate group or the value of a rate group table’s cell.
Exactly one of no_shipping
, flat_rate
,
price_percentage
, carrier_rateName
,
subtable_name
must be set.
Fields§
§no_shipping: Option<bool>
If true, then the product can’t be shipped. Must be true when set, can only be set if all other fields are not set.
flat_rate: Option<Price>
A flat rate. Can only be set if all other fields are not set.
price_percentage: Option<String>
A percentage of the price represented as a number in decimal notation
(For example, "5.4"
). Can only be set if all other fields are not
set.
carrier_rate: Option<String>
The name of a carrier rate referring to a carrier rate defined in the same rate group. Can only be set if all other fields are not set.
subtable: Option<String>
The name of a subtable. Can only be set in table cells (For example, not for single values), and only if all other fields are not set.
Implementations§
source§impl Value
impl Value
sourcepub fn no_shipping(&self) -> bool
pub fn no_shipping(&self) -> bool
Returns the value of no_shipping
, or the default value if no_shipping
is unset.
sourcepub fn price_percentage(&self) -> &str
pub fn price_percentage(&self) -> &str
Returns the value of price_percentage
, or the default value if price_percentage
is unset.
sourcepub fn carrier_rate(&self) -> &str
pub fn carrier_rate(&self) -> &str
Returns the value of carrier_rate
, or the default value if carrier_rate
is unset.
Trait Implementations§
source§impl Message for Value
impl Message for Value
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Value
impl PartialEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request