Skip to main content

IsData

Struct IsData 

Source
#[non_exhaustive]
pub struct IsData { pub cst_is: String, pub c_class_trib_is: String, pub v_bc_is: Option<String>, pub p_is: Option<String>, pub p_is_espec: Option<String>, pub u_trib: Option<String>, pub q_trib: Option<String>, pub v_is: String, }
Expand description

IS (Imposto Seletivo / IBS+CBS) input data – PL_010 tax reform. Goes inside <imposto> as an alternative/addition to ICMS.

String fields are pre-formatted (e.g. “100.00”, “5.0000”) because the IS schema uses mixed decimal precisions that don’t map to a single cents/rate convention.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§cst_is: String

IS tax situation code

§c_class_trib_is: String

IS tax classification code

§v_bc_is: Option<String>

Tax base (optional, e.g. “100.00”)

§p_is: Option<String>

IS rate (optional, e.g. “5.0000”)

§p_is_espec: Option<String>

Specific rate (optional, e.g. “1.5000”)

§u_trib: Option<String>

Taxable unit of measure (optional, e.g. “LT”)

§q_trib: Option<String>

Taxable quantity (optional, e.g. “10.0000”)

§v_is: String

IS tax value (e.g. “5.00”)

Implementations§

Source§

impl IsData

Source

pub fn new( cst_is: impl Into<String>, c_class_trib_is: impl Into<String>, v_is: impl Into<String>, ) -> Self

Create a new IsData with required fields.

cst_is is the IS tax situation code, c_class_trib_is is the IS classification code, and v_is is the pre-formatted IS value string (e.g. "5.00").

Source

pub fn v_bc_is(self, v: impl Into<String>) -> Self

Set the IS calculation base (vBCIS), e.g. "100.00".

Source

pub fn p_is(self, v: impl Into<String>) -> Self

Set the IS ad-valorem rate (pIS), e.g. "5.0000".

Source

pub fn p_is_espec(self, v: impl Into<String>) -> Self

Set the IS specific rate (pISEspec), e.g. "1.5000".

Source

pub fn u_trib(self, v: impl Into<String>) -> Self

Set the taxable unit of measure (uTrib), e.g. "LT".

Source

pub fn q_trib(self, v: impl Into<String>) -> Self

Set the taxable quantity (qTrib), e.g. "10.0000".

Trait Implementations§

Source§

impl Clone for IsData

Source§

fn clone(&self) -> IsData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IsData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IsData

Source§

fn default() -> IsData

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for IsData

Source§

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 Serialize for IsData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TaxCalculation for IsData

Source§

fn build_xml(&self) -> String

Build the IS (IBS/CBS) XML string, delegating to build_is_xml.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,