Гайд по использованию на русском языке можно посмотреть здесь и задать вопросы по использованию, но не оставляйте там комментарии об ошибках, т.к. там сложно это обсуждать. Лучше создайте issue в этом репозитории.
Library for simple 1C:Enterprise platform Native API Component development, originates from findings of this medigor/example-native-api-rs
Crate is tested on Linux and Windows. It should work on MacOS as well, but it is not tested.
Structure
Library is divided into two submodules:
native_api_1c_coredescribes all necessary for implementing 1C:Enterprise Native APInative_api_1c_macroprovides a tool for significant simplification of component implementation, taking care ofnative_api_1c_core::interface::AddInWrapperproperty implementation
Usage
Attributes #[add_in_prop(...)]
name- property name in 1Cname_ru- property name in 1C in Russianreadable- property is readable from 1Cwritable- property is writable from 1C
Available property types: i32, f64, bool, String
Functions or procedures #[add_in_func(...)]
name- property name in 1Cname_ru- property name in 1C in Russian
Input arguments, #[arg(...)], for each type of argument must be set, on of:
Int-i32Float-f64Bool-boolStr-StringDate-chrono::DateTime<chrono::FixedOffset>Blob-Vec<u8>
Return values, #[returns(...)], type must be set, one of:
Int-i32Float-f64Bool-boolStr-StringDate-chrono::DateTime<chrono::FixedOffset>Blob-Vec<u8>None-()Additionally,Result<T, ()>can be used, whereTis one of the above. In this case,resultmust be set in#[returns(...)]attribute:#[returns(Int, result)]forResult<i32, ()>
Example
# Cargo.toml
[]
= "my_addin"
= "0.1.0"
= "2021"
[]
= ["cdylib"]
[]
= "2.0"
= "0.10.3"
// src/lib.rs
use Arc;
use ;