pub struct Eric;Expand description
A structure to manage the Eric instance from the shared C library.
Use Eric::new to initialize Eric. Closes Eric when dropped.
Implementations§
Source§impl Eric
impl Eric
Sourcepub fn new(
log_path: Option<&Path>,
plugin_path: Option<&Path>,
) -> Result<Self, EricError>
pub fn new( log_path: Option<&Path>, plugin_path: Option<&Path>, ) -> Result<Self, EricError>
Initializes a single-threaded Eric instance.
If log_path is None, the system directory for temporary files is
used. If plugin_path is None, the path to the shared C library is
used.
Sourcepub fn validate(
&self,
xml: String,
taxonomy_type: &str,
taxonomy_version: &str,
pdf_path: Option<&str>,
) -> Result<EricResponse, EricError>
pub fn validate( &self, xml: String, taxonomy_type: &str, taxonomy_version: &str, pdf_path: Option<&str>, ) -> Result<EricResponse, EricError>
Validates an XML file for a specific taxonomy.
Optionally, a confirmation is printed to pdf_path.
Sourcepub fn send(
&self,
xml: String,
taxonomy_type: &str,
taxonomy_version: &str,
certificate_path: &Path,
certificate_password: &str,
pdf_path: Option<&str>,
) -> Result<EricResponse, EricError>
pub fn send( &self, xml: String, taxonomy_type: &str, taxonomy_version: &str, certificate_path: &Path, certificate_password: &str, pdf_path: Option<&str>, ) -> Result<EricResponse, EricError>
Sends an XML file for a specific taxonomy to the tax authorities.
The Elster certificate needs to be provided at path certificate_path
with password certificate_password.
Optionally, a confirmation is printed to pdf_path.
Sourcepub fn check_xml(
&self,
xml: String,
taxonomy_type: &str,
taxonomy_version: &str,
) -> Result<EricResponse, EricError>
pub fn check_xml( &self, xml: String, taxonomy_type: &str, taxonomy_version: &str, ) -> Result<EricResponse, EricError>
Validates an XML file against the schema of a specific taxonomy.
This is a schema-only check via ERiC’s EricCheckXML and does not
execute the full validation/send pipeline of Eric::validate or
Eric::send.
Note that ERiC may report unsupported data types/versions for this API function.