Skip to main content

NfeBuilder

Struct NfeBuilder 

Source
pub struct NfeBuilder { /* private fields */ }
Expand description

Builder para construção de NF-e

Implementations§

Source§

impl NfeBuilder

Source

pub fn new() -> Self

Cria um novo builder

Source

pub fn codigo_uf(self, uf: u8) -> Self

Define o código da UF (ex: 35 para SP)

Source

pub fn numero(self, numero: u32) -> Self

Define o número da NF-e

Source

pub fn serie(self, serie: u16) -> Self

Define a série da NF-e

Source

pub fn modelo(self, modelo: ModeloDocumentoFiscal) -> Self

Define o modelo (55 = NF-e, 65 = NFC-e)

Source

pub fn natureza_operacao(self, natureza: &str) -> Self

Define a natureza da operação

Source

pub fn tipo_operacao(self, tipo: TipoOperacao) -> Self

Define o tipo de operação (Entrada/Saída)

Source

pub fn destino_operacao(self, destino: DestinoOperacao) -> Self

Define o destino da operação

Source

pub fn finalidade(self, finalidade: FinalidadeEmissao) -> Self

Define a finalidade da emissão

Source

pub fn ambiente(self, ambiente: TipoAmbiente) -> Self

Define o ambiente (Produção/Homologação)

Source

pub fn codigo_municipio(self, codigo: u32) -> Self

Define o código do município

Source

pub fn emit_cnpj(self, cnpj: &str) -> Self

Define o CNPJ do emitente

Source

pub fn emit_razao_social(self, razao: &str) -> Self

Define a razão social do emitente

Source

pub fn emit_nome_fantasia(self, fantasia: &str) -> Self

Define o nome fantasia do emitente

Source

pub fn emit_ie(self, ie: &str) -> Self

Define a IE do emitente

Source

pub fn emit_endereco(self, endereco: Endereco) -> Self

Define o endereço do emitente

Source

pub fn dest_cnpj(self, cnpj: &str) -> Self

Define o CNPJ do destinatário

Source

pub fn dest_razao_social(self, razao: &str) -> Self

Define a razão social do destinatário

Source

pub fn dest_indicador_ie(self, indicador: IndicadorContribuicaoIe) -> Self

Define o indicador de IE do destinatário

Source

pub fn dest_endereco(self, endereco: Endereco) -> Self

Define o endereço do destinatário

Source

pub fn add_item(self, item: ItemBuilder) -> Self

Adiciona um item à NF-e

Source

pub fn modalidade_frete(self, modalidade: ModalidadeFrete) -> Self

Define a modalidade do frete

Source

pub fn informacao_complementar(self, info: &str) -> Self

Define informações complementares

Source

pub fn build(self) -> Result<Nfe, String>

Constrói a NF-e

Trait Implementations§

Source§

impl Debug for NfeBuilder

Source§

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

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

impl Default for NfeBuilder

Source§

fn default() -> NfeBuilder

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

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> 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, 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.