{"id":489367,"date":"2026-07-31T17:03:02","date_gmt":"2026-07-31T17:03:02","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=489367"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=489367","title":{"rendered":"CONTRACT: \u043e\u0434\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>One contract. Any format. Zero mapping.<\/strong><\/p>\n<p>\u041b\u044e\u0431\u043e\u0439 C+\u00b1\u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435: \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0435\u0431\u0430\u0433\u0435, \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043e\u0442\u0434\u0430\u0442\u044c \u043f\u043e protobuf \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 JSON. \u0411\u0435\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0441\u0441\u044b\u043f\u044c \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f: <code>toJson<\/code>, <code>toProto<\/code>, <code>debugPrint<\/code>, <code>writeBinary<\/code>. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0438\u0445.<\/p>\n<pre><code>N \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u00d7 M \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 = N\u00d7M \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u044b \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u043a\u0442\u043e \u0432 C++ \u0443\u043f\u0435\u0440\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0441\u0442\u0435\u043d\u0443. \u0420\u044f\u0434\u043e\u043c \u0441\u0442\u043e\u044f\u0442 <a href=\"https:\/\/github.com\/getml\/reflect-cpp\" rel=\"noopener noreferrer nofollow\">reflect-cpp<\/a> (C++20-\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f, JSON\/BSON\/CBOR\/msgpack\/TOML\/XML\/YAML\/Avro\/Cap\u2019n Proto \u0438 \u0434\u0440\u0443\u0433\u0438\u0435), <a href=\"https:\/\/github.com\/GerHobbelt\/serde-cpp\" rel=\"noopener noreferrer nofollow\">serde-cpp<\/a> (\u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d Rust serde) \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 Boost.Serialization\/Cereal. \u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 CONTRACT \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u201c\u043e\u0434\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 &#8212; \u043c\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432\u201d, \u0440\u0430\u0437 \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u0443\u0436\u0435 \u043d\u0435 \u043d\u043e\u0432\u0430.<\/p>\n<h3>\u041d\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440<\/h3>\n<p>CONTRACT \u0440\u0435\u0448\u0430\u0435\u0442 N\u00d7M \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>N \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 + M \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0445\u0435\u043c\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u044f\u043c\u043e \u0432 C+\u00b1\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<pre><code class=\"cpp\">struct Order {    std::uint64_t id;    std::string customer;    double amount;    bool paid;    CONTRACT(Order,        (id, 1),        (customer, 2),        (amount, 3),        (paid, 4)    )};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>CONTRACT(...)<\/code> \u043d\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0430\u043c. \u041e\u043d \u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439: id, \u0438\u043c\u044f, \u0442\u0438\u043f, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0445\u043e\u0434\u0430. \u0418\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435: \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 \u0441\u0445\u0435\u043c\u044b, \u0430\u0443\u0434\u0438\u0442-\u0434\u0430\u043c\u043f. CONTRACT &#8212; \u043d\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c-\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f, \u043d\u0435 generic-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043d\u0435 schema-first \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440. \u042f\u0434\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438 \u043a\u0430\u043a \u0434\u043e \u043d\u0435\u0433\u043e \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0430 \u043d\u0435 \u0437\u0430 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 wire-\u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u042d\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430.<\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 reflect-cpp: reflect-cpp \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u201c\u043a\u0430\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 N \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432\u201d. CONTRACT \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u201c\u043a\u0430\u043a \u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f\u201d.<\/p>\n<h3>\u0411\u044b\u043b\u043e \/ \u0441\u0442\u0430\u043b\u043e<\/h3>\n<p>\u0411\u0435\u0437 \u043e\u0431\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u044b <code>Order<\/code> \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">struct Order {    std::uint64_t id;    std::string customer;    double amount;    bool paid;    std::string toJson() const {        std::ostringstream out;        out &lt;&lt; \"{\\\"id\\\":\" &lt;&lt; id            &lt;&lt; \",\\\"customer\\\":\\\"\" &lt;&lt; customer &lt;&lt; \"\\\"\"            &lt;&lt; \",\\\"amount\\\":\" &lt;&lt; amount            &lt;&lt; \",\\\"paid\\\":\" &lt;&lt; (paid ? \"true\" : \"false\") &lt;&lt; \"}\";        return out.str();    }    void debugPrint(std::ostream&amp; out) const {        out &lt;&lt; \"Order{id=\" &lt;&lt; id &lt;&lt; \", customer=\" &lt;&lt; customer            &lt;&lt; \", amount=\" &lt;&lt; amount &lt;&lt; \", paid=\" &lt;&lt; paid &lt;&lt; \"}\";    }    void writeBinary(std::vector&lt;std::uint8_t&gt;&amp; buf) const { \/* ... *\/ }};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043b\u044e\u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 <code>order.proto<\/code>, <code>protoc<\/code>, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 <code>.pb.h<\/code>\/<code>.pb.cc<\/code> \u0438 \u0440\u0443\u0447\u043d\u043e\u0439 <code>toProto<\/code>\/<code>fromProto<\/code> \u043c\u0435\u0436\u0434\u0443 <code>Order<\/code> \u0438 <code>OrderProto<\/code>. \u0427\u0435\u0442\u044b\u0440\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &#8212; \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u0442\u0430, \u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u043d\u0435\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b.<\/p>\n<p>\u0421 CONTRACT <code>Order<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 (\u0441\u043c. \u0432\u044b\u0448\u0435), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0444\u043e\u0440\u043c\u0430\u0442 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">contract::cout &lt;&lt; order;contract::adapters::json::to_string(order);binary_out &lt;&lt; order;proto_out &lt;&lt; order;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>Order<\/code> \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 &#8212; \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0435\u0440\u0435\u0437 \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442.<\/p>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u0438\u0434\u043d\u0430 \u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443: \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0432 <code>CONTRACT(...)<\/code> \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430. \u0412 \u201c\u0431\u044b\u043b\u043e\u201d-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u0440\u0430\u0437\u0443 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445: <code>toJson<\/code>, <code>debugPrint<\/code>, <code>writeBinary<\/code>, <code>.proto<\/code>-\u0444\u0430\u0439\u043b\u0435 \u0438 \u0440\u0443\u0447\u043d\u043e\u043c <code>toProto<\/code>\/<code>fromProto<\/code>. \u0418 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c.<\/p>\n<h3>\u0427\u0435\u0433\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0448\u0438\u0440\u0435, \u0447\u0435\u043c \u201c\u043e\u0434\u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e N \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432\u201d. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b:<\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u044b\u043b \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0441\u0430\u043c\u043e\u043c C++ \u0442\u0438\u043f\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0430: <\/p>\n<ul>\n<li>\n<p>id<\/p>\n<\/li>\n<li>\n<p>\u0438\u043c\u044f<\/p>\n<\/li>\n<li>\n<p>\u0442\u0438\u043f<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044e.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: <\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 (<code>BASE<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443 (<code>PROPERTY<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0438\u043f \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442 (<code>REFERENCE<\/code>).<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u043b\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443, \u0430 \u043d\u0435 \u044f\u0434\u0440\u0443: \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u043e\u043b\u0435\u0439, \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f: <\/p>\n<ul>\n<li>\n<p>\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (protobuf, JSON, compact, binary, \u2026)<\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0441\u0445\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0430\u0443\u0434\u0438\u0442-\u0434\u0430\u043c\u043f.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u043e\u0432\u0435\u0440\u0445 \u043f\u043e\u043b\u0435\u0439 \u0431\u044b\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432: \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442 \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443: <\/p>\n<ul>\n<li>\n<p>security<\/p>\n<\/li>\n<li>\n<p>check<\/p>\n<\/li>\n<li>\n<p>unit.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u044e\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0440\u0430\u043d\u0442\u0430\u0439\u043c.<\/p>\n<\/li>\n<\/ol>\n<h3>\u042f\u0434\u0440\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430<\/h3>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c &#8212; \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0441 id, \u0438\u043c\u0435\u043d\u0435\u043c, \u0442\u0438\u043f\u043e\u043c \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044e. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 compile-time API, \u043f\u043e\u0432\u0435\u0440\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435:<\/p>\n<pre><code class=\"cpp\">contract::field_count&lt;Order&gt;();                        \/\/ \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0439contract::field_at&lt;0, Order&gt;();                        \/\/ \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u043e\u043b\u044f \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443contract::dispatch_field_by_id&lt;Order&gt;(2, fn);          \/\/ \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u043b\u0435 \u043f\u043e idcontract::dispatch_field_by_name&lt;Order&gt;(\"amount\", fn); \/\/ \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438contract::type_name&lt;Order&gt;();                          \/\/ \"Order\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u043e\u043b\u044f \u043d\u0435\u0441\u0435\u0442 id, \u0438\u043c\u044f \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (<code>get<\/code>\/<code>set<\/code>\/<code>ref<\/code>). \u042d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043e\u0442 wire-\u043a\u043e\u0434\u0435\u043a\u0430 \u0434\u043e \u0434\u0435\u0431\u0430\u0433-\u0434\u0430\u043c\u043f\u0430, \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432\u043d\u0443\u0442\u0440\u044c \u0441\u0430\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 id, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u044f: \u0434\u0435\u043b\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043d\u0430 wire (\u0438\u043c\u044f \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u0434\u043e\u043b\u044c\u0448\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0435) &#8212; \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0438\u043c\u044f \u044d\u0442\u043e \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0441 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c, \u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0447\u043d\u0443\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0431\u0430\u0439\u0442\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c id (<code>contract::schema::reserved_id(...)<\/code>) &#8212; \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0440\u043a\u0435\u0440, \u043d\u0438 \u043e\u0434\u0438\u043d \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442.<\/p>\n<h3>\u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430: BASE, PROPERTY \u0438 REFERENCE<\/h3>\n<p>\u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0443\u043d\u043a\u0442: \u043f\u043e\u043b\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0431\u044b\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0423 CONTRACT \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430.<\/p>\n<p><code><strong>BASE(Type, offset)<\/strong><\/code> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e C+\u00b1\u0442\u0438\u043f\u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c id, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e:<\/p>\n<pre><code class=\"cpp\">struct Header {    std::uint64_t request_id;    CONTRACT(Header, (request_id, 1))};struct Event : public Header {    std::string name;    CONTRACT(Event,        BASE(Header, 100),        (name, 1)    )};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>Event<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <code>request_id<\/code> \u043f\u043e\u0434 id 101 (100 + 1) \u0438 \u0441\u0432\u043e\u0435 <code>name<\/code> \u043f\u043e\u0434 id 1. \u041e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 <code>Header<\/code> \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p><code><strong>PROPERTY(name, id, type)<\/strong><\/code> &#8212; \u043f\u043e\u043b\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0447\u043b\u0435\u043d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430 \u0441\u0442\u043e\u0438\u0442 \u043f\u0430\u0440\u0430 <code>contract_get<\/code>\/<code>contract_set<\/code>:<\/p>\n<pre><code class=\"cpp\">struct Metric {    std::uint32_t raw_count = 0;    CONTRACT(Metric,        (raw_count, 1),        PROPERTY(doubled_count, 2, std::uint32_t)    )    std::uint32_t contract_get(const contract_fields::doubled_count&amp;) const {        return raw_count * 2;    }    void contract_set(const contract_fields::doubled_count&amp;, std::uint32_t value) {        raw_count = value \/ 2;    }};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u0432\u0438\u0434\u044f\u0442 <code>doubled_count<\/code> \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435: \u0447\u0438\u0442\u0430\u044e\u0442 \u0438 \u043f\u0438\u0448\u0443\u0442 \u0435\u0433\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0443\u0442\u0435\u043c, \u0447\u0442\u043e \u0438 <code>raw_count<\/code>, \u0445\u043e\u0442\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 <code>Metric<\/code> \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0442. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u0435\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 <code>contract_get<\/code>\/<code>contract_set<\/code>.<\/p>\n<p><code><strong>REFERENCE(name, id)<\/strong><\/code> &#8212; \u0442\u0440\u0435\u0442\u0438\u0439 \u0432\u0438\u0434 \u043f\u043e\u043b\u044f: \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u043c \u043b\u043e\u0433\u0433\u0435\u0440\u0435 CONTRACT, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u043c \u043f\u0443\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">template&lt;class T&gt;struct payload_field {    std::string_view name;    const T&amp; value;    CONTRACT(payload_field,        (name, 1),        REFERENCE(value, 2)    )};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>value<\/code> &#8212; \u0441\u0441\u044b\u043b\u043a\u0430, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u044f; \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0447\u0438\u0442\u0430\u0435\u0442 \u0435\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043d\u043e \u043b\u043e\u0433-\u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u043f\u043b\u0430\u0442\u0438\u0442 \u0437\u0430 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e\/\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u0443\u043d\u043a\u0442 &#8212; \u0444\u043e\u0440\u043c\u0430\u0442 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443, \u0430 \u043d\u0435 \u044f\u0434\u0440\u0443. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432 CONTRACT \u0448\u0435\u0441\u0442\u044c \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432, \u0438 \u043d\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b \u043f\u043e \u0447\u0442\u0435\u043d\u0438\u044e\/\u0437\u0430\u043f\u0438\u0441\u0438. \u041d\u0438\u0436\u0435: \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0410\u0434\u0430\u043f\u0442\u0435\u0440<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">protobuf<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u043b\u043d\u044b\u0439: wire-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c protobuf, \u043e\u0431\u0433\u043e\u043d\u044f\u0435\u0442 libprotobuf \u0432 20\/28 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 (<a href=\"https:\/\/habr.com\/ru\/articles\/1064148\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a>)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">binary<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u043b\u043d\u044b\u0439: \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0435\u0437 wire-\u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430, \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u043d\u043e \u043d\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">compact<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u043b\u043d\u044b\u0439: \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 wire-\u0444\u043e\u0440\u043c\u0430\u0442, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439, \u043a\u0442\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">JSON<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u044c, \u0437\u0430\u0442\u043e \u0441 security-\u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 (redact\/omit) &#8212; \u043d\u0430 \u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d structured logging<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">structured logging<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u043e\u043d\u043a\u0430\u044f \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 JSON-\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432, \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 wire-\u0444\u043e\u0440\u043c\u0430\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">console\/debug<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0434\u0435\u0431\u0430\u0433-\u0432\u044b\u0432\u043e\u0434<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">YAML<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2713<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435: \u0441\u0442\u0440\u043e\u0433\u0438\u0439 config-reader, \u0430 \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 &#8212; \u043f\u0438\u0441\u0430\u0442\u044c \u0432 YAML CONTRACT \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041e\u0431\u0449\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435: <code>contract<\/code> \u0437\u043d\u0430\u0435\u0442 \u043f\u043e\u043b\u044f \u0438 \u0438\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u0444\u043e\u0440\u043c\u0430\u0442, <code>io<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c. \u0410 \u0432\u043e\u0442 <code>writer<\/code>\/<code>reader<\/code> \u0438 <code>codec&lt;T&gt;<\/code> \u0443\u0436\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u0438 \u0437\u043d\u0430\u044e\u0442 \u0435\u0433\u043e wire-\u043f\u0440\u0430\u0432\u0438\u043b\u0430 &#8212; \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0432\u043e\u0438.<\/p>\n<h3>\u0421\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/h3>\n<p>\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0431\u044b\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u043e\u0432\u0435\u0440\u0445 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u0435 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 id \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443. \u041d\u0430\u0431\u043e\u0440 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c &#8212; \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f \u044f\u0434\u0440\u043e; \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 <code>security<\/code> \u0438 <code>check<\/code>.<\/p>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 PII \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438:<\/p>\n<pre><code class=\"cpp\">struct AuthEvent {    std::string user_email;    std::string access_token;    std::uint64_t duration_ns;    CONTRACT(AuthEvent,        (user_email, 1, contract::security::sensitive()),        (access_token, 2,            contract::security::secret(),            contract::security::no_log(),            contract::security::encrypt()),        (duration_ns, 3)    )};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 <code>AuthEvent<\/code>, \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0433\u043e <code>if<\/code> \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043e\u0434\u0435, \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. Console\/debug \u0438 JSON \u043f\u043e\u043a\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 <code>secret<\/code>\/<code>no_log<\/code>\/<code>sensitive<\/code> &#8212; \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0432\u043e\u0439 \u0434\u0435\u0444\u043e\u043b\u0442, \u0430 \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0447\u0435\u0440\u0435\u0437 <code>options<\/code>, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435. \u0410 \u0432 binary <code>encrypt()<\/code> \u0441\u0435\u0433\u043e\u0434\u043d\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u043d\u0435 \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f. \u0422\u0430\u043a\u0430\u044f per-field \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0438 \u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 (\u0443 protobuf \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 field options); \u0440\u0430\u0437\u043d\u0438\u0446\u0430 CONTRACT \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b &#8212; \u0430 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e.<\/p>\n<p>\u0422\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043b\u043e\u0433\u0435 (\u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 <code>examples\/logging.cpp<\/code>):<\/p>\n<pre><code class=\"cpp\">struct SecretPayment {    std::uint64_t order_id;    std::string_view token;    CONTRACT(SecretPayment,        (order_id, 1),        (token, 2, contract::security::secret()))};contract::logging::options opt{};opt.json.secret = contract::adapters::json::security_mode::redact;contract::logging::logger log{out, opt};SecretPayment secret_payment{18, \"tok_live_123\"};log.info(\"payment_sensitive\", \"Captured sensitive payment metadata\",    contract::logging::attribute(\"payment\", secret_payment));<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 (\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e &#8212; \u0441\u043c. <code>examples\/logging.cpp<\/code>):<\/p>\n<pre><code class=\"json\">{\"name\":\"payment_sensitive\",\"attributes\":[{\"name\":\"payment\",\"value\":{\"order_id\":18,\"token\":\"&lt;redacted&gt;\"}}]}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>token<\/code> \u043f\u043e\u043f\u0430\u043b \u0432 \u043b\u043e\u0433 \u043a\u0430\u043a <code>\"&lt;redacted&gt;\"<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043a \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 <code>opt.json.secret<\/code>.<\/p>\n<h3>\u041d\u0435 \u0432 \u0443\u0449\u0435\u0440\u0431 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043f\u044f\u0442\u043e\u0435: \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0440\u0430\u043d\u0442\u0430\u0439\u043c. \u041e\u0434\u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e N\u00d7M &#8212; \u044d\u0442\u043e, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043f\u0440\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f \u0446\u0435\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: protobuf-\u0430\u0434\u0430\u043f\u0442\u0435\u0440 CONTRACT \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438 \u0441 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c libprotobuf \u043d\u0430 14 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445. CONTRACT \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044f \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f &#8212; \u0432 <a href=\"https:\/\/habr.com\/ru\/articles\/1064148\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e protobuf-\u0430\u0434\u0430\u043f\u0442\u0435\u0440<\/a>.<\/p>\n<h3>\u0427\u0435\u0433\u043e CONTRACT \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u201c\u043d\u0430 \u0432\u0441\u0435\u201d:<\/p>\n<ul>\n<li>\n<p>\u043d\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c-\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f &#8212; \u043e\u0431\u0445\u043e\u0434 \u043f\u043e\u043b\u0435\u0439 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 generic-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 &#8212; \u0444\u043e\u0440\u043c\u0430\u0442 \u0438 \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443, \u044f\u0434\u0440\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0434\u0438\u043a\u0442\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 schema-first \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 &#8212; \u043d\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u0445\u0435\u043c\u044b \u0438 \u0448\u0430\u0433\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438, \u0441\u0445\u0435\u043c\u0430 &#8212; \u044d\u0442\u043e \u0441\u0430\u043c\u0430 C++ \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0431\u0443\u0444\u0435\u0440\u043e\u0432, SQL \u0438\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0440\u0430\u043d\u0442\u0430\u0439\u043c-\u043a\u043e\u0434\u0430 &#8212; \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430, \u0430 \u043d\u0435 \u044f\u0434\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440: \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0437 YAML + \u0434\u0435\u0431\u0430\u0433-\u0432\u044b\u0432\u043e\u0434<\/h3>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a &#8212; \u043a\u043e\u0434 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (<code>examples\/yaml_file_read.cpp<\/code>): \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0438\u0442\u0430\u0435\u0442 YAML-\u0430\u0434\u0430\u043f\u0442\u0435\u0440, \u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 &#8212; debug-\u0430\u0434\u0430\u043f\u0442\u0435\u0440.<\/p>\n<pre><code class=\"cpp\">struct PaymentConfig {    std::string service;    std::uint32_t port = 0;    bool enabled = false;    std::vector&lt;std::string&gt; tags;    CONTRACT(PaymentConfig,        (service, 1),        (port, 2),        (enabled, 3),        (tags, 4))};contract::adapters::yaml::reader&lt;contract::io::file_buffer_input&gt; in(    contract::io::file_buffer_input{\"payment_config.yaml\"});PaymentConfig config{};in &gt;&gt; config;contract::cout.debug() &lt;&lt; config;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c <code>payment_config.yaml<\/code>:<\/p>\n<pre><code class=\"yaml\">service: paymentport: 8080enabled: truetags:  - api  - payments  - production<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0432\u044b\u0432\u043e\u0434 &#8212; \u0441\u043d\u044f\u0442 \u0441 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430:<\/p>\n<pre><code>PaymentConfig:  service: \"payment\"  # #1 std::string  port: 8080          # #2 u32  enabled: true       # #3 bool  tags:               # #4 std::vector&lt;std::string&gt;, size=3    - \"api\"           # [0]    - \"payments\"      # [1]    - \"production\"    # [2]<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e\u0442 \u0436\u0435 <code>PaymentConfig<\/code>, \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. Id \u0438 \u0442\u0438\u043f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0432\u044b\u0432\u043e\u0434 \u0441\u0430\u043c\u0438, \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u0430\u043a\u0440\u043e\u0441, \u0430 \u043d\u0435 C++26 reflection<\/h3>\n<p><strong>\u041d\u0435 \u043e\u0442\u043c\u0435\u043d\u0438\u0442 \u043b\u0438 reflection \u043d\u0443\u0436\u043d\u043e\u0441\u0442\u044c CONTRACT \u0446\u0435\u043b\u0438\u043a\u043e\u043c?<\/strong> C++26 reflection \u0443\u043c\u0435\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0447\u043b\u0435\u043d\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0435\u0437 \u043c\u0430\u043a\u0440\u043e\u0441\u0430. \u042d\u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 &#8212; \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043b\u0435\u0439. \u041d\u043e \u0441\u0430\u043c\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0434\u0435\u043d\u0435\u0442\u0441\u044f: CONTRACT \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 id, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b (\u0441\u043c. \u0432\u044b\u0448\u0435), \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442-\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 (<code>security::secret()<\/code>, <code>schema::reserved_id()<\/code>), \u0438 \u0447\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u043c, \u0435\u0441\u043b\u0438 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0447\u043b\u0435\u043d\u0430 \u0437\u0430 \u043d\u0438\u043c \u043d\u0435\u0442 (<code>PROPERTY<\/code>). \u0418 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f: \u043e\u043d\u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c, \u0442\u0430\u043a \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u0431\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0438 \u0431\u044b\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 &#8212; \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u043c \u0438\u043b\u0438 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0435\u0439. Reflect-cpp \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0439 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: \u043d\u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e id, \u043d\u0438 attribute-\u0441\u043b\u043e\u044f, \u043d\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0443 \u043d\u0435\u0433\u043e \u043d\u0435\u0442.<\/p>\n<p><strong>\u0410 \u0441\u0430\u043c\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b &#8212; \u043d\u0435 \u043f\u043b\u043e\u0445\u0430\u044f \u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430?<\/strong> \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e: \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0435\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 &#8212; \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0446\u0435\u043d\u0430. \u0410 \u0432\u043e\u0442 \u0441 \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u044b \u043f\u0440\u0438\u0446\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c: \u043e\u043f\u0435\u0447\u0430\u0442\u0430\u043b\u0441\u044f \u0438 \u0434\u0430\u043b \u0434\u0432\u0443\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u0434\u0438\u043d id &#8212; \u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 <code>static_assert<\/code> (<code>\"CONTRACT field ids must be unique after BASE offsets are applied\"<\/code>), \u0430 \u043d\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430. \u041d\u043e <code>CONTRACT(...)<\/code> &#8212; \u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u044f\u0447\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u043b\u0438 control flow; \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u044b \u043f\u043e\u043b\u0435\u0439, \u0442\u0435\u043c \u0436\u0435 \u043f\u0443\u0442\u0435\u043c, \u0447\u0442\u043e <code>Q_OBJECT<\/code> \u0432 Qt, <code>TEST(...)<\/code> \u0432 gtest \u0438\u043b\u0438 <code>BOOST_DESCRIBE_STRUCT<\/code> \u0432 Boost.Describe. \u0418 \u043f\u043e\u043a\u0430 static reflection \u043d\u0435 \u0441\u0442\u0430\u043b\u0430 \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043e\u043c, \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0432 \u0441\u0430\u043c\u043e\u043c C+\u00b1\u0442\u0438\u043f\u0435.<\/p>\n<h3>\u0418\u0442\u043e\u0433<\/h3>\n<p>\u0421\u043c\u044b\u0441\u043b CONTRACT \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0441\u0445\u0435\u043c\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0440\u044f\u0434\u043e\u043c \u0441 \u0442\u0438\u043f\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 binary \u0438\u043b\u0438 protobuf, \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 YAML, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 debug-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043b\u043e\u0433 \u2014 \u0431\u0435\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u043d\u0435 \u043f\u043b\u0430\u0442\u044f\u0442 \u0437\u0430 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u043b\u0438\u0448\u043d\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/p>\n<p>\u041e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432.<\/p>\n<p>CONTRACT &#8212; \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b compile-time \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u043e\u0432\u044b\u0445 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432, \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438 \u0443\u0447\u0430\u0441\u0442\u0438\u044e \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u041a\u043e\u0434 &#8212; <a href=\"https:\/\/github.com\/antako76\/Contract\" rel=\"noopener noreferrer nofollow\">github.com\/antako76\/Contract<\/a>.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1065488\/\">https:\/\/habr.com\/ru\/articles\/1065488\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One contract. Any format. Zero mapping.\u041b\u044e\u0431\u043e\u0439 C+\u00b1\u043f\u0440\u043e\u0435\u043a\u0442, \u0433\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0443\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435: \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0435\u0431\u0430\u0433\u0435, \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043e\u0442\u0434\u0430\u0442\u044c \u043f\u043e protobuf \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 JSON. \u0411\u0435\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0441\u0441\u044b\u043f\u044c \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f: toJson, toProto, debugPrint, writeBinary. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043d\u0438\u0445.N \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u00d7 M \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 = N\u00d7M \u0440\u0443\u0447\u043d\u044b\u0445 \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432\u041c\u044b \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u043a\u0442\u043e \u0432 C++ \u0443\u043f\u0435\u0440\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0441\u0442\u0435\u043d\u0443. \u0420\u044f\u0434\u043e\u043c \u0441\u0442\u043e\u044f\u0442 reflect-cpp (C++20-\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f, JSON\/BSON\/CBOR\/msgpack\/TOML\/XML\/YAML\/Avro\/Cap\u2019n Proto \u0438 \u0434\u0440\u0443\u0433\u0438\u0435), serde-cpp (\u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d Rust serde) \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 Boost.Serialization\/Cereal. \u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 CONTRACT \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u201c\u043e\u0434\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 &#8212; \u043c\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432\u201d, \u0440\u0430\u0437 \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u0443\u0436\u0435 \u043d\u0435 \u043d\u043e\u0432\u0430.\u041d\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440CONTRACT \u0440\u0435\u0448\u0430\u0435\u0442 N\u00d7M \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:N \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 + M \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432\u0421\u0445\u0435\u043c\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u044f\u043c\u043e \u0432 C+\u00b1\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:struct Order {    std::uint64_t id;    std::string customer;    double amount;    bool paid;    CONTRACT(Order,        (id, 1),        (customer, 2),        (amount, 3),        (paid, 4)    )};CONTRACT(&#8230;) \u043d\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0430\u043c. \u041e\u043d \u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u0435\u0439: id, \u0438\u043c\u044f, \u0442\u0438\u043f, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0445\u043e\u0434\u0430. \u0418\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435: \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 \u0441\u0445\u0435\u043c\u044b, \u0430\u0443\u0434\u0438\u0442-\u0434\u0430\u043c\u043f. CONTRACT &#8212; \u043d\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c-\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f, \u043d\u0435 generic-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0438 \u043d\u0435 schema-first \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440. \u042f\u0434\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438 \u043a\u0430\u043a \u0434\u043e \u043d\u0435\u0433\u043e \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0430 \u043d\u0435 \u0437\u0430 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 wire-\u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u042d\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430.\u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441 reflect-cpp: reflect-cpp \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u201c\u043a\u0430\u043a \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 N \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432\u201d. CONTRACT \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u201c\u043a\u0430\u043a \u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f\u201d.\u0411\u044b\u043b\u043e \/ \u0441\u0442\u0430\u043b\u043e\u0411\u0435\u0437 \u043e\u0431\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u044b Order \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:struct Order {    std::uint64_t id;    std::string customer;    double amount;    bool paid;    std::string toJson() const {        std::ostringstream out;        out &lt;&lt; &#171;{\\&#187;id\\&#187;:&#187; &lt;&lt; id            &lt;&lt; &#171;,\\&#187;customer\\&#187;:\\&#187;&#187; &lt;&lt; customer &lt;&lt; &#171;\\&#187;&#187;            &lt;&lt; &#171;,\\&#187;amount\\&#187;:&#187; &lt;&lt; amount            &lt;&lt; &#171;,\\&#187;paid\\&#187;:&#187; &lt;&lt; (paid ? &#171;true&#187; : &#171;false&#187;) &lt;&lt; &#171;}&#187;;        return out.str();    }    void debugPrint(std::ostream&amp; out) const {        out &lt;&lt; &#171;Order{id=&#187; &lt;&lt; id &lt;&lt; &#171;, customer=&#187; &lt;&lt; customer            &lt;&lt; &#171;, amount=&#187; &lt;&lt; amount &lt;&lt; &#171;, paid=&#187; &lt;&lt; paid &lt;&lt; &#171;}&#187;;    }    void writeBinary(std::vector&lt;std::uint8_t&gt;&amp; buf) const { \/* &#8230; *\/ }};\u041f\u043b\u044e\u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 order.proto, protoc, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 .pb.h\/.pb.cc \u0438 \u0440\u0443\u0447\u043d\u043e\u0439 toProto\/fromProto \u043c\u0435\u0436\u0434\u0443 Order \u0438 OrderProto. \u0427\u0435\u0442\u044b\u0440\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &#8212; \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u0442\u0430, \u043a\u0443\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u043d\u0435\u0441\u0442\u0438 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b.\u0421 CONTRACT Order \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 (\u0441\u043c. \u0432\u044b\u0448\u0435), \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0444\u043e\u0440\u043c\u0430\u0442 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430:contract::cout &lt;&lt; order;contract::adapters::json::to_string(order);binary_out &lt;&lt; order;proto_out &lt;&lt; order;Order \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 &#8212; \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0435\u0440\u0435\u0437 \u0447\u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442.\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432\u0438\u0434\u043d\u0430 \u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443: \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0432 CONTRACT(&#8230;) \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430. \u0412 \u201c\u0431\u044b\u043b\u043e\u201d-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u0440\u0430\u0437\u0443 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445: toJson, debugPrint, writeBinary, .proto-\u0444\u0430\u0439\u043b\u0435 \u0438 \u0440\u0443\u0447\u043d\u043e\u043c toProto\/fromProto. \u0418 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u0431\u044b\u0442\u044c.\u0427\u0435\u0433\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0448\u0438\u0440\u0435, \u0447\u0435\u043c \u201c\u043e\u0434\u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e N \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u043e\u0432\u201d. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b:\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u044b\u043b \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0441\u0430\u043c\u043e\u043c C++ \u0442\u0438\u043f\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0430: id\u0438\u043c\u044f\u0442\u0438\u043f\u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044e.\u041f\u043e\u043b\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 (BASE)\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443 (PROPERTY)\u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0438\u043f \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442 (REFERENCE).\u0424\u043e\u0440\u043c\u0430\u0442 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u043b\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443, \u0430 \u043d\u0435 \u044f\u0434\u0440\u0443: \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u043e\u043b\u0435\u0439, \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f: \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (protobuf, JSON, compact, binary, \u2026)\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0441\u0445\u0435\u043c\u044b\u0430\u0443\u0434\u0438\u0442-\u0434\u0430\u043c\u043f.\u041f\u043e\u0432\u0435\u0440\u0445 \u043f\u043e\u043b\u0435\u0439 \u0431\u044b\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432: \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442 \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443: securitycheckunit.\u0412\u0441\u0435 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u044e\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0440\u0430\u043d\u0442\u0430\u0439\u043c.\u042f\u0434\u0440\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c &#8212; \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0441 id, \u0438\u043c\u0435\u043d\u0435\u043c, \u0442\u0438\u043f\u043e\u043c \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u043b\u044e. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 compile-time API, \u043f\u043e\u0432\u0435\u0440\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435:contract::field_count&lt;Order&gt;();                        \/\/ \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0439contract::field_at&lt;0, Order&gt;();                        \/\/ \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u043e\u043b\u044f \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443contract::dispatch_field_by_id&lt;Order&gt;(2, fn);          \/\/ \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u043b\u0435 \u043f\u043e idcontract::dispatch_field_by_name&lt;Order&gt;(&#171;amount&#187;, fn); \/\/ \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438contract::type_name&lt;Order&gt;();                          \/\/ &#171;Order&#187;\u0414\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u043f\u043e\u043b\u044f \u043d\u0435\u0441\u0435\u0442 id, \u0438\u043c\u044f \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (get\/set\/ref). \u042d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u043e\u0442 wire-\u043a\u043e\u0434\u0435\u043a\u0430 \u0434\u043e \u0434\u0435\u0431\u0430\u0433-\u0434\u0430\u043c\u043f\u0430, \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432\u043d\u0443\u0442\u0440\u044c \u0441\u0430\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.\u041a\u0441\u0442\u0430\u0442\u0438, \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 id, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u044f: \u0434\u0435\u043b\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043d\u0430 wire (\u0438\u043c\u044f \u0434\u043b\u0438\u043d\u043d\u0435\u0435, \u0434\u043e\u043b\u044c\u0448\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0443\u043f\u0430\u043a\u043e\u0432\u043a\u0435) &#8212; \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c. \u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0438\u043c\u044f \u044d\u0442\u043e \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0441 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c, \u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0447\u043d\u0443\u0442 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0431\u0430\u0439\u0442\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c id (contract::schema::reserved_id(&#8230;)) &#8212; \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0440\u043a\u0435\u0440, \u043d\u0438 \u043e\u0434\u0438\u043d \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0435\u0433\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442.\u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430: BASE, PROPERTY \u0438 REFERENCE\u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0443\u043d\u043a\u0442: \u043f\u043e\u043b\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d\u043e \u0431\u044b\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u0423 CONTRACT \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430.BASE(Type, offset) \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e C+\u00b1\u0442\u0438\u043f\u0430 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c id, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0433\u043e:struct Header {    std::uint64_t request_id;    CONTRACT(Header, (request_id, 1))};struct Event : public Header {    std::string name;    CONTRACT(Event,        BASE(Header, 100),        (name, 1)    )};Event \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 request_id \u043f\u043e\u0434 id 101 (100 + 1) \u0438 \u0441\u0432\u043e\u0435 name \u043f\u043e\u0434 id 1. \u041e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 Header \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430.PROPERTY(name, id, type) &#8212; \u043f\u043e\u043b\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0447\u043b\u0435\u043d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430 \u0441\u0442\u043e\u0438\u0442 \u043f\u0430\u0440\u0430 contract_get\/contract_set:struct Metric {    std::uint32_t raw_count = 0;    CONTRACT(Metric,        (raw_count, 1),        PROPERTY(doubled_count, 2, std::uint32_t)    )    std::uint32_t contract_get(const contract_fields::doubled_count&amp;) const {        return raw_count * 2;    }    void contract_set(const contract_fields::doubled_count&amp;, std::uint32_t value) {        raw_count = value \/ 2;    }};\u0410\u0434\u0430\u043f\u0442\u0435\u0440\u044b \u0432\u0438\u0434\u044f\u0442 doubled_count \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435: \u0447\u0438\u0442\u0430\u044e\u0442 \u0438 \u043f\u0438\u0448\u0443\u0442 \u0435\u0433\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0443\u0442\u0435\u043c, \u0447\u0442\u043e \u0438 raw_count, \u0445\u043e\u0442\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 Metric \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0442. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u0435\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 contract_get\/contract_set.REFERENCE(name, id) &#8212; \u0442\u0440\u0435\u0442\u0438\u0439 \u0432\u0438\u0434 \u043f\u043e\u043b\u044f: \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u0435\u0442, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u043c \u043b\u043e\u0433\u0433\u0435\u0440\u0435 CONTRACT, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u043c \u043f\u0443\u0442\u0438:template&lt;class T&gt;struct payload_field {    std::string_view name;    const T&amp; value;    CONTRACT(payload_field,        (name, 1),        REFERENCE(value, 2)    )};value &#8212; \u0441\u0441\u044b\u043b\u043a\u0430, \u0430 \u043d\u0435 \u043a\u043e\u043f\u0438\u044f; \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0447\u0438\u0442\u0430\u0435\u0442 \u0435\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043d\u043e \u043b\u043e\u0433-\u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u043f\u043b\u0430\u0442\u0438\u0442 \u0437\u0430 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044e\/\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.\u042d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432\u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u0443\u043d\u043a\u0442 &#8212; \u0444\u043e\u0440\u043c\u0430\u0442 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443, \u0430 \u043d\u0435 \u044f\u0434\u0440\u0443. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0432 CONTRACT \u0448\u0435\u0441\u0442\u044c \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432, \u0438 \u043d\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b \u043f\u043e \u0447\u0442\u0435\u043d\u0438\u044e\/\u0437\u0430\u043f\u0438\u0441\u0438. \u041d\u0438\u0436\u0435: \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:\u0410\u0434\u0430\u043f\u0442\u0435\u0440\u0417\u0430\u043f\u0438\u0441\u044c\u0427\u0442\u0435\u043d\u0438\u0435\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439protobuf\u2713\u2713\u043f\u043e\u043b\u043d\u044b\u0439: wire-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u043c protobuf, \u043e\u0431\u0433\u043e\u043d\u044f\u0435\u0442 libprotobuf \u0432 20\/28 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 (\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f)binary\u2713\u2713\u043f\u043e\u043b\u043d\u044b\u0439: \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0435\u0437 wire-\u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430, \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u043d\u043e \u043d\u0435 \u043a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044ecompact\u2713\u2713\u043f\u043e\u043b\u043d\u044b\u0439: \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 wire-\u0444\u043e\u0440\u043c\u0430\u0442, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439, \u043a\u0442\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438JSON\u2713-\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u044c, \u0437\u0430\u0442\u043e \u0441 security-\u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 (redact\/omit) &#8212; \u043d\u0430 \u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d structured loggingstructured logging\u2713-\u0442\u043e\u043d\u043a\u0430\u044f \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 JSON-\u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432, \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 wire-\u0444\u043e\u0440\u043c\u0430\u0442console\/debug\u2713-\u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0434\u0435\u0431\u0430\u0433-\u0432\u044b\u0432\u043e\u0434YAML-\u2713\u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435: \u0441\u0442\u0440\u043e\u0433\u0438\u0439 config-reader, \u0430 \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 &#8212; \u043f\u0438\u0441\u0430\u0442\u044c \u0432 YAML CONTRACT \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442\u041e\u0431\u0449\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435: contract \u0437\u043d\u0430\u0435\u0442 \u043f\u043e\u043b\u044f \u0438 \u0438\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u0444\u043e\u0440\u043c\u0430\u0442, io \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u043e\u043c. \u0410 \u0432\u043e\u0442 writer\/reader \u0438 codec&lt;T&gt; \u0443\u0436\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u0438 \u0437\u043d\u0430\u044e\u0442 \u0435\u0433\u043e wire-\u043f\u0440\u0430\u0432\u0438\u043b\u0430 &#8212; \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0441\u0432\u043e\u0438.\u0421\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432\u0427\u0435\u0442\u0432\u0435\u0440\u0442\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0431\u044b\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u043e\u0432\u0435\u0440\u0445 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u0435 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 id \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443. \u041d\u0430\u0431\u043e\u0440 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c &#8212; \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f \u044f\u0434\u0440\u043e; \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 security \u0438 check.\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 PII \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438:struct AuthEvent {    std::string user_email;    std::string access_token;    std::uint64_t duration_ns;    CONTRACT(AuthEvent,        (user_email, 1, contract::security::sensitive()),        (access_token, 2,            contract::security::secret(),            contract::security::no_log(),            contract::security::encrypt()),        (duration_ns, 3)    )};\u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 AuthEvent, \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0433\u043e if \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043a\u043e\u0434\u0435, \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430. Console\/debug \u0438 JSON \u043f\u043e\u043a\u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 secret\/no_log\/sensitive &#8212; \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0432\u043e\u0439 \u0434\u0435\u0444\u043e\u043b\u0442, \u0430 \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0447\u0435\u0440\u0435\u0437 options, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435. \u0410 \u0432 binary encrypt() \u0441\u0435\u0433\u043e\u0434\u043d\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0444\u0443\u0441\u043a\u0430\u0446\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u043d\u0435 \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f. \u0422\u0430\u043a\u0430\u044f per-field \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0438 \u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 (\u0443 protobuf \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 field options); \u0440\u0430\u0437\u043d\u0438\u0446\u0430&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-489367","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/489367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=489367"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/489367\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=489367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=489367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=489367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}