diff --git a/Cargo.lock b/Cargo.lock index 9e8e9a709d..c9ddedf816 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,9 +122,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arc-swap" @@ -162,7 +162,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "synstructure", ] @@ -174,7 +174,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -185,7 +185,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -297,7 +297,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.87", + "syn 2.0.104", "which", ] @@ -377,13 +377,13 @@ checksum = "3fce8dd7fcfcbf3a0a87d8f515194b49d6135acab73e18bd380d1d93bb1a15eb" dependencies = [ "clap", "heck 0.4.1", - "indexmap 2.6.0", + "indexmap 2.10.0", "log", "proc-macro2", "quote", "serde", "serde_json", - "syn 2.0.87", + "syn 2.0.104", "tempfile", "toml", ] @@ -442,8 +442,10 @@ checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-link", ] @@ -499,7 +501,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -717,7 +719,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -728,7 +730,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -825,7 +827,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -836,9 +838,9 @@ checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "embedded-io" @@ -881,7 +883,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1021,7 +1023,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1125,7 +1127,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1311,7 +1313,7 @@ dependencies = [ "iceoryx2-pal-testing", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1537,7 +1539,7 @@ dependencies = [ "iceoryx2-bb-elementary-traits", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1547,6 +1549,8 @@ dependencies = [ "iceoryx2", "iceoryx2-bb-log", "pyo3", + "pyo3-stub-gen", + "pyo3-stub-gen-derive", ] [[package]] @@ -1751,7 +1755,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -1794,9 +1798,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1818,6 +1822,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + [[package]] name = "ipnetwork" version = "0.20.0" @@ -1989,9 +2002,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lz4_flex" @@ -2002,6 +2015,12 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "matchers" version = "0.1.0" @@ -2011,6 +2030,16 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + [[package]] name = "memchr" version = "2.7.4" @@ -2061,6 +2090,21 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "ndarray" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "portable-atomic", + "portable-atomic-util", + "rawpointer", +] + [[package]] name = "nix" version = "0.29.0" @@ -2135,6 +2179,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -2181,6 +2234,22 @@ dependencies = [ "libc", ] +[[package]] +name = "numpy" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f1dee9aa8d3f6f8e8b9af3803006101bb3653866ef056d530d53ae68587191" +dependencies = [ + "libc", + "ndarray", + "num-complex", + "num-integer", + "num-traits", + "pyo3", + "pyo3-build-config", + "rustc-hash 2.1.1", +] + [[package]] name = "object" version = "0.36.5" @@ -2292,7 +2361,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -2313,7 +2382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.10.0", ] [[package]] @@ -2346,7 +2415,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -2429,6 +2498,15 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + [[package]] name = "postcard" version = "1.1.3" @@ -2463,14 +2541,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -2521,7 +2599,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -2534,7 +2612,41 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.87", + "syn 2.0.104", +] + +[[package]] +name = "pyo3-stub-gen" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650d9624b551894664cc95867ccfe4fd814a5a225c8fe3a75194a3ae51caae1d" +dependencies = [ + "anyhow", + "chrono", + "either", + "indexmap 2.10.0", + "inventory", + "itertools 0.13.0", + "log", + "maplit", + "num-complex", + "numpy", + "pyo3", + "pyo3-stub-gen-derive", + "serde", + "toml", +] + +[[package]] +name = "pyo3-stub-gen-derive" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73947c71903f0e3e31a302a350567594063c75ac155031e40519721429898649" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -2594,9 +2706,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -2666,6 +2778,12 @@ dependencies = [ "getrandom 0.3.2", ] +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + [[package]] name = "redox_users" version = "0.4.6" @@ -2694,7 +2812,7 @@ checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -2992,7 +3110,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3060,7 +3178,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3071,7 +3189,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3088,9 +3206,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -3114,7 +3232,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.10.0", "serde", "serde_derive", "serde_json", @@ -3131,7 +3249,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3140,7 +3258,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.10.0", "itoa", "ryu", "serde", @@ -3306,9 +3424,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -3323,7 +3441,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3381,7 +3499,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3392,7 +3510,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3513,7 +3631,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3555,9 +3673,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", @@ -3567,26 +3685,33 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.10.0", "serde", "serde_spanned", "toml_datetime", + "toml_write", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "tracing" version = "0.1.40" @@ -3607,7 +3732,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -3827,7 +3952,7 @@ checksum = "dcba0282a9f9297af06b91ff22615e7f77f0ab66f75fc95898960d1604fc7fd7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "unzip-n", ] @@ -3896,7 +4021,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -3918,7 +4043,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4042,7 +4167,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -4053,7 +4178,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -4296,9 +4421,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] @@ -4361,7 +4486,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "synstructure", ] @@ -4699,7 +4824,7 @@ checksum = "dcd9d20407128f32b02032737af0e26a7960d11e1db8a3e1b88c14675b851a01" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "zenoh-keyexpr", ] @@ -4874,7 +4999,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -4885,7 +5010,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] [[package]] @@ -4905,7 +5030,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", "synstructure", ] @@ -4934,5 +5059,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.104", ] diff --git a/examples/python/publish_subscribe/publisher.py b/examples/python/publish_subscribe/publisher.py index c92ce97a5d..8e8baced80 100644 --- a/examples/python/publish_subscribe/publisher.py +++ b/examples/python/publish_subscribe/publisher.py @@ -12,8 +12,8 @@ """Publisher example.""" -import iceoryx2 as iox2 from transmission_data import TransmissionData +import iceoryx2 as iox2 cycle_time = iox2.Duration.from_secs(1) diff --git a/iceoryx2-ffi/python/Cargo.toml b/iceoryx2-ffi/python/Cargo.toml index 45b76a5c73..8dd8fc110f 100644 --- a/iceoryx2-ffi/python/Cargo.toml +++ b/iceoryx2-ffi/python/Cargo.toml @@ -14,12 +14,20 @@ readme = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] name = "_iceoryx2" -crate-type = ["cdylib"] +crate-type = ["cdylib", "rlib"] + +[[bin]] +name = "iceoryx2_ffi_python_stubgen" +path = "src/stubgen.rs" +doc = false [dependencies] iceoryx2 = { workspace = true } iceoryx2-bb-log = { workspace = true } +pyo3-stub-gen = "0.12.2" +pyo3-stub-gen-derive = "0.12.2" + [dependencies.pyo3] version = "0.25.0" features = ["abi3-py38"] diff --git a/iceoryx2-ffi/python/poetry.lock b/iceoryx2-ffi/python/poetry.lock index 0e6eeea172..d02608f223 100644 --- a/iceoryx2-ffi/python/poetry.lock +++ b/iceoryx2-ffi/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. [[package]] name = "astroid" @@ -612,14 +612,14 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pylint" -version = "3.3.7" +version = "3.3.8" description = "python code static checker" optional = false python-versions = ">=3.9.0" groups = ["dev"] files = [ - {file = "pylint-3.3.7-py3-none-any.whl", hash = "sha256:43860aafefce92fca4cf6b61fe199cdc5ae54ea28f9bf4cd49de267b5195803d"}, - {file = "pylint-3.3.7.tar.gz", hash = "sha256:2b11de8bde49f9c5059452e0c310c079c746a0a8eeaa789e5aa966ecc23e4559"}, + {file = "pylint-3.3.8-py3-none-any.whl", hash = "sha256:7ef94aa692a600e82fabdd17102b73fc226758218c97473c7ad67bd4cb905d83"}, + {file = "pylint-3.3.8.tar.gz", hash = "sha256:26698de19941363037e2937d3db9ed94fb3303fdadf7d98847875345a8bb6b05"}, ] [package.dependencies] @@ -691,6 +691,28 @@ files = [ [package.dependencies] pylint = ">=1.7" +[[package]] +name = "pyo3-stubgen" +version = "0.3.0" +description = "Enable hinting for pyo3 extension modules by generating type and docstring stubs" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pyo3_stubgen-0.3.0-py3-none-any.whl", hash = "sha256:a05c32ddf1981be043fa5015f24d625b4eb631c27769e0db475acf4b28e5acc3"}, + {file = "pyo3_stubgen-0.3.0.tar.gz", hash = "sha256:57434fb833d5a3e54942e6f5fde486b56412bf02319cf528068254da58b95327"}, +] + +[package.dependencies] +click = "*" + +[package.extras] +cov = ["pyo3-stubgen[test]", "pytest-cov"] +dev = ["pyo3-stubgen[cov,doc,lint,test]"] +doc = ["black", "mkdocs", "mkdocs-material", "mkdocstrings[python]"] +lint = ["ruff"] +test = ["pytest", "pytest-doctest-mkdocstrings"] + [[package]] name = "pytest" version = "8.4.1" @@ -988,4 +1010,4 @@ test = ["pytest"] [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "702ca1669f5900bdb924d20eab907f14dc3aca42002dd1e496947f229d388407" +content-hash = "840af537072d8f9c8ded1190e7d7d61ac400c2ce88e14e44e8b2b15b66f3e66f" diff --git a/iceoryx2-ffi/python/pyproject.toml b/iceoryx2-ffi/python/pyproject.toml index b5321058b9..712988e858 100644 --- a/iceoryx2-ffi/python/pyproject.toml +++ b/iceoryx2-ffi/python/pyproject.toml @@ -64,6 +64,7 @@ black = "^25.1.0" isort = "^6.0.1" bandit = "^1.8.6" maturin = "^1.9.1" +pyo3-stubgen = "^0.3.0" [tool.poetry.requires-plugins] poethepoet = { version = "~0.35.0", extras = ["poetry_plugin"]} @@ -74,6 +75,9 @@ poetry_command = "" [tool.poe.tasks.build-into-venv] shell = "maturin develop --manifest-path Cargo.toml --target-dir ../../target/ffi/python" +[tool.poe.tasks.generate-stubs] +shell = "pyo3-stubgen iceoryx2._iceoryx2 python-src/" + [tool.poe.tasks.check-imports] sequence = [ { shell = "isort --check-only ../../examples/python" }, diff --git a/iceoryx2-ffi/python/python-src/iceoryx2/_iceoryx2.pyi b/iceoryx2-ffi/python/python-src/iceoryx2/_iceoryx2.pyi new file mode 100644 index 0000000000..a7511b2c10 --- /dev/null +++ b/iceoryx2-ffi/python/python-src/iceoryx2/_iceoryx2.pyi @@ -0,0 +1,3311 @@ +# This file is automatically generated by pyo3_stub_gen +# ruff: noqa: E501, F401 + +import builtins +import typing +from enum import Enum + +class ActiveRequest: + r""" + The `ActiveRequest` represents the object that contains the payload that the `Client` sends to the + `Server`. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def is_connected(self) -> builtins.bool: + r""" + Returns `True` until the `PendingResponse` goes out of scope on the `Client`s side + indicating that the `Client` no longer receives the `ResponseMut`. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload of the received `RequestMut`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user_header of the received `RequestMut` + """ + @property + def header(self) -> RequestHeader: + r""" + Returns the `RequestHeader` of the received `RequestMut` + """ + @property + def origin(self) -> UniqueClientId: + r""" + Returns the `UniqueClientId` of the `Client` + """ + def delete(self) -> None: + r""" + Releases the `ActiveRequest` and terminates the connection. + + After this call the `ActiveRequest` is no longer usable! + """ + def __loan_uninit(self) -> ResponseMutUninit: + r""" + Loans uninitialized memory for a `ResponseMut` where the user can write its payload to. + """ + def __loan_slice_uninit(self, slice_len:builtins.int) -> ResponseMutUninit: + r""" + Loans/allocates a `ResponseMutUninit` from the underlying data segment of the + `Server`. The user has to initialize the payload before it can be sent. + + On failure it emits `LoanError` describing the failure. + """ + +class Alignment: + r""" + Contains the alignment memory can have. + """ + @staticmethod + def new(value:builtins.int) -> Alignment: + r""" + Creates a new `Alignment`. If the value is zero or not a power of 2 + it emits an `InvalidAlignmentValue`. + """ + def value(self) -> builtins.int: + r""" + Returns the value of the `Alignment` + """ + +class AliveNodeView: + r""" + Contains all details of a `Node` that is alive. + """ + @property + def id(self) -> NodeId: + r""" + Returns the `NodeId`. + """ + @property + def details(self) -> typing.Optional[NodeDetails]: + r""" + Returns optional `NodeDetails` that contains further information about the `Node`. + Can only be acquired when the process has the access right to read it. + """ + +class Attribute: + r""" + Represents a single service attribute (key-value) pair that can be defined when the service + is being created. + """ + @property + def key(self) -> AttributeKey: + r""" + Acquires the service attribute key + """ + @property + def value(self) -> AttributeValue: + r""" + Acquires the service attribute value + """ + @staticmethod + def new(key:AttributeKey, value:AttributeValue) -> Attribute: + r""" + Creates an attribute instance + """ + +class AttributeKey: + r""" + Relocatable (inter-process shared memory compatible) `SemanticString` implementation for + `AttributeKey`. + """ + @staticmethod + def new(value:builtins.str) -> AttributeKey: + r""" + Creates a new `AttributeKey` when the provided `value` does not exceed + `AttributeKey.max_len()`, otherwise it emits a `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `AttributeKey` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `AttributeKey` into a `String` + """ + +class AttributeSet: + r""" + Represents a single service attribute (key-value) pair that can be defined when the service + is being created. + """ + @property + def number_of_attributes(self) -> builtins.int: + r""" + Returns the number of `Attribute`s stored inside the `AttributeSet`. + """ + @property + def values(self) -> builtins.list[Attribute]: + r""" + Returns all `Attribute`s stored in the `AttributeSet` + """ + @staticmethod + def capacity() -> builtins.int: + r""" + Returns the maximum number of `Attribute`s the `AttributeSet` can hold. + """ + def key_values(self, key:AttributeKey) -> builtins.list[AttributeValue]: + r""" + Returns all `AttributeValue` that belong to a specified `AttributeKey`. + """ + +class AttributeSpecifier: + r""" + Represents a single service attribute (key-value) pair that can be defined when the service + is being created. + """ + @property + def attributes(self) -> AttributeSet: + r""" + Returns the underlying `AttributeSet` + """ + @staticmethod + def new() -> AttributeSpecifier: + r""" + Creates a new empty set of `Attribute`s + """ + def define(self, key:AttributeKey, value:AttributeValue) -> AttributeSpecifier: + r""" + Defines a value for a specific key. A key is allowed to have multiple values. + """ + +class AttributeValue: + r""" + Relocatable (inter-process shared memory compatible) `SemanticString` implementation for + `AttributeValue`. + """ + @staticmethod + def new(value:builtins.str) -> AttributeValue: + r""" + Creates a new `AttributeValue` when the provided `value` does not exceed + `AttributeValue.max_len()`, otherwise it emits a `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `AttributeValue` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `AttributeValue` into a `String` + """ + +class AttributeVerifier: + r""" + Represents a single service attribute (key-value) pair that can be defined when the service + is being created. + """ + @property + def required_attributes(self) -> AttributeSet: + r""" + Returns the underlying required `AttributeSet` + """ + @property + def required_keys(self) -> builtins.list[AttributeKey]: + r""" + Returns the underlying required keys + """ + @staticmethod + def new() -> AttributeVerifier: + r""" + Creates a new empty set of `Attribute`s + """ + def require(self, key:AttributeKey, value:AttributeValue) -> AttributeVerifier: + r""" + Requires a value for a specific key. A key is allowed to have multiple values. + """ + def require_key(self, key:AttributeKey) -> AttributeVerifier: + r""" + Requires that a specific key is defined. + """ + def verify_requirements(self, rhs:AttributeSet) -> typing.Optional[AttributeKey]: + r""" + Verifies if the `AttributeSet` contains all required keys and key-value pairs. If it does + not satisfy the requirements it returns the first + """ + +class CleanupState: + r""" + Returned by `Node.cleanup_dead_nodes()`. Contains the cleanup report of the call + and contains the number of dead nodes that were successfully cleaned up and how many + could not be cleaned up. + This does not have to be an error, for instance when the current process does not + have the permission to access the corresponding resources. + """ + @property + def cleanups(self) -> builtins.int: + r""" + The number of successful dead node cleanups + """ + @property + def failed_cleanups(self) -> builtins.int: + r""" + The number of failed dead node cleanups + """ + +class Client: + r""" + Represents the receiving endpoint of an event based communication. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def id(self) -> UniqueClientId: + r""" + Returns the `UniqueClientId` of the `Client` + """ + @property + def unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + Returns the strategy the `Client` follows when a `RequestMut` cannot be delivered + if the `Server`s buffer is full. + """ + def delete(self) -> None: + r""" + Releases the `Client`. + + After this call the `Client` is no longer usable! + """ + def __loan_uninit(self) -> RequestMutUninit: + r""" + Acquires an `RequestMutUninit` to store payload. This API shall be used + by default to avoid unnecessary copies. + """ + def __loan_slice_uninit(self, slice_len:builtins.int) -> RequestMutUninit: + r""" + Loans/allocates a `RequestMutUninit` from the underlying data segment of the `Client`. + The user has to initialize the payload before it can be sent. + + On failure it emits a `LoanError` describing the failure. + """ + def initial_max_slice_len(self) -> builtins.int: + r""" + Returns the maximum initial slice length configured for this `Client`. + """ + +class Config: + r""" + Represents the configuration that iceoryx2 will utilize. It is divided into two sections: + the [Global] settings, which must align with the iceoryx2 instance the application intends to + join, and the [Defaults] for communication within that iceoryx2 instance. The user has the + flexibility to override both sections. + """ + @property + def global_cfg(self) -> Global: + r""" + Returns the `Global` part of the config + """ + @property + def defaults(self) -> Defaults: + r""" + Returns the `Defaults` part of the config + """ + def __eq__(self, other:Config) -> builtins.bool: ... + def __str__(self) -> builtins.str: ... + +class DeadNodeView: + r""" + Contains all details of a `Node` that is dead. + """ + @property + def id(self) -> NodeId: + r""" + Returns the `NodeId`. + """ + @property + def details(self) -> typing.Optional[NodeDetails]: + r""" + Returns optional `NodeDetails` that contains further information about the `Node`. + Can only be acquired when the process has the access right to read it. + """ + def remove_stale_resources(self) -> builtins.bool: + r""" + Removes all stale resources of the dead `Node`. On error it emits a `NodeCleanupFailure`. + It returns true if the stale resources could be removed, otherwise false. + """ + +class Defaults: + r""" + Default settings. These values are used when the user in the code does not specify anything + else. + """ + @property + def publish_subscribe(self) -> PublishSubscribe: + r""" + Returns the publish_subscribe part of the default settings + """ + @property + def event(self) -> Event: + r""" + Returns the event part of the default settings + """ + @property + def request_response(self) -> RequestResponse: + r""" + Returns the request_response part of the default settings + """ + def __str__(self) -> builtins.str: ... + +class Duration: + r""" + Represents a time duration. + """ + @staticmethod + def from_micros(micros:builtins.int) -> Duration: + r""" + Creates a new `Duration` from a given number of micro seconds + """ + @staticmethod + def from_millis(millis:builtins.int) -> Duration: + r""" + Creates a new `Duration` from a given number of milli seconds + """ + @staticmethod + def from_nanos(nanos:builtins.int) -> Duration: + r""" + Creates a new `Duration` from a given number of nano seconds + """ + @staticmethod + def from_secs(secs:builtins.int) -> Duration: + r""" + Creates a new `Duration` from a given number of seconds + """ + @staticmethod + def from_secs_f64(secs:builtins.float) -> Duration: + r""" + Creates a new `Duration` from a given number of seconds + """ + def as_secs(self) -> builtins.int: + r""" + Returns the number of seconds stored in the `Duration` + """ + def as_secs_f64(self) -> builtins.float: + r""" + Returns the number of seconds stored in the `Duration` + """ + def as_millis(self) -> builtins.int: + r""" + Returns the number of milli seconds stored in the `Duration` + """ + def as_micros(self) -> builtins.int: + r""" + Returns the number of micro seconds stored in the `Duration` + """ + def as_nanos(self) -> builtins.int: + r""" + Returns the number of nano seconds stored in the `Duration` + """ + def subsec_micros(self) -> builtins.int: + r""" + Returns the fractional micro seconds part stored in the `Duration` + """ + def subsec_millis(self) -> builtins.int: + r""" + Returns the fractional milli seconds part stored in the `Duration` + """ + def subsec_nanos(self) -> builtins.int: + r""" + Returns the fractional nano seconds part stored in the `Duration` + """ + +class Event: + r""" + Default settings for the event messaging pattern. These settings are used unless + the user specifies custom QoS or port settings. + """ + @property + def max_listeners(self) -> builtins.int: + r""" + The maximum amount of supported `Listener` + """ + @property + def max_notifiers(self) -> builtins.int: + r""" + The maximum amount of supported `Notifier` + """ + @property + def max_nodes(self) -> builtins.int: + r""" + The maximum amount of supported `Node`s. Defines indirectly how many + processes can open the service at the same time. + """ + @property + def event_id_max_value(self) -> builtins.int: + r""" + The largest event id supported by the event service + """ + @property + def deadline(self) -> Duration: + r""" + Defines the maximum allowed time between two consecutive notifications. If a notifiation + is not sent after the defined time, every `Listener` + that is attached to a `WaitSet` will be notified. + """ + @property + def notifier_created_event(self) -> builtins.int: + r""" + Defines the event id value that is emitted after a new notifier was created. If it is + not set then `usize::MAX` is returned + """ + @property + def has_notifier_created_event(self) -> builtins.bool: + r""" + Returns true if the notifier created event was set, otherwise false. + """ + @property + def notifier_dropped_event(self) -> builtins.int: + r""" + Defines the event id value that is emitted before a new notifier is dropped. + """ + @property + def has_notifier_dropped_event(self) -> builtins.bool: + r""" + Returns true if the notifier dropped event was set, otherwise false. + """ + @property + def notifier_dead_event(self) -> builtins.int: + r""" + Defines the event id value that is emitted if a notifier was identified as dead. + """ + @property + def has_notifier_dead_event(self) -> builtins.bool: + r""" + Returns true if the notifier dead event was set, otherwise false. + """ + @max_listeners.setter + def max_listeners(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Listener` + """ + @max_notifiers.setter + def max_notifiers(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Notifier` + """ + @max_nodes.setter + def max_nodes(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Node`s. + """ + @event_id_max_value.setter + def event_id_max_value(self, value: builtins.int) -> None: + r""" + Set the largest event id supported by the event service + """ + @deadline.setter + def deadline(self, value: Duration) -> None: + r""" + Sets the deadline of the event service. + """ + @notifier_created_event.setter + def notifier_created_event(self, value: builtins.int) -> None: + r""" + Sets the event id value that is emitted after a new notifier was created. + """ + @notifier_dropped_event.setter + def notifier_dropped_event(self, value: builtins.int) -> None: + r""" + Sets the event id value that is emitted before a new notifier is dropped. + """ + @notifier_dead_event.setter + def notifier_dead_event(self, value: builtins.int) -> None: + r""" + Sets the event id value that is emitted if a notifier was identified as dead. + """ + def __str__(self) -> builtins.str: ... + def disable_notifier_created_event(self) -> None: + r""" + Do not emit an event whenever a notifier was created. + """ + def disable_notifier_dropped_event(self) -> None: + r""" + Do not emit an event whenever a notifier was dropped. + """ + def disable_notifier_dead_event(self) -> None: + r""" + Do not emit an event whenever a notifier was identified as dead. + """ + +class EventId: + r""" + User defined identifier that can be provided in `Notifier.notify()` to signal a specific + kind of event. + """ + @property + def as_value(self) -> builtins.int: + r""" + Returns the integer value of the `EventId` + """ + @staticmethod + def new(value:builtins.int) -> EventId: + r""" + Creates a new `EventId` from a given integer value + """ + +class FileDescriptor: + r""" + Represents a FileDescriptor in a POSIX system. Contains always a value greater or equal zero, + a valid file descriptor. It takes the ownership of the provided file descriptor and calls + `posix::close` on destruction. + """ + @property + def native_handle(self) -> builtins.int: + r""" + Returns the underlying value of the FileDescriptor + + # Safety + + * the user shall not store the value in a variable otherwise lifetime issues may be + encountered + * do not manually close the file descriptor with a sys call + """ + @staticmethod + def non_owning_new(value:builtins.int) -> typing.Optional[FileDescriptor]: + r""" + Creates a FileDescriptor which does not hold the ownership of the file descriptor and will + not call `posix::close` on destruction. + """ + @staticmethod + def new(value:builtins.int) -> typing.Optional[FileDescriptor]: + r""" + Creates a new FileDescriptor. If the value is smaller than zero it returns [`None`]. + """ + +class FileName: + r""" + Relocatable (inter-process shared memory compatible) `SemanticString` implementation for + `FileName`. All modification operations ensure that never an + invalid file or path name can be generated. All strings have a fixed size so that the maximum + path or file name length the system supports can be stored. + """ + @staticmethod + def new(name:builtins.str) -> FileName: + r""" + Creates a new `FileName` when the provided `name` contains a valid path to a file, + otherwise it emits a `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `FileName` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `FileName` into a `String` + """ + +class FilePath: + r""" + Relocatable (inter-process shared memory compatible) `SemanticString` implementation for + `FilePath`. All modification operations ensure that never an + invalid file or path name can be generated. All strings have a fixed size so that the maximum + path or file name length the system supports can be stored. + """ + @staticmethod + def new(name:builtins.str) -> FilePath: + r""" + Creates a new `FilePath` when the provided `name` contains a valid path to a file, + otherwise it emits a `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `FilePath` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `FilePath` into a `String` + """ + +class Global: + r""" + The global settings + """ + @property + def service(self) -> Service: + r""" + Returns the service part of the global configuration + """ + @property + def node(self) -> Node: + r""" + Returns the node part of the global configuration + """ + @property + def service_dir(self) -> Path: + r""" + Returns the directory under which service files are stored. + """ + @property + def node_dir(self) -> Path: + r""" + Returns the directory under which node files are stored. + """ + @property + def root_path(self) -> Path: + r""" + The path under which all other directories or files will be created + """ + @property + def prefix(self) -> FileName: + r""" + Prefix used for all files created during runtime + """ + @root_path.setter + def root_path(self, value: Path) -> None: + r""" + Defines the path under which all other directories or files will be created + """ + @prefix.setter + def prefix(self, value: FileName) -> None: + r""" + Set the prefix used for all files created during runtime + """ + def __str__(self) -> builtins.str: ... + +class HeaderPublishSubscribe: + r""" + Sample header used by `MessagingPattern::PublishSubscribe` + """ + @property + def node_id(self) -> NodeId: + r""" + Returns the `NodeId` of the source node that published the `Sample`. + """ + @property + def publisher_id(self) -> UniquePublisherId: + r""" + Returns the `UniquePublisherId` of the source `Publisher`. + """ + @property + def number_of_elements(self) -> builtins.int: + r""" + Returns how many elements are stored inside the `Sample`'s payload. + """ + +class Listener: + r""" + Represents the receiving endpoint of an event based communication. + """ + @property + def deadline(self) -> typing.Optional[Duration]: + r""" + Returns the deadline of the corresponding `Service`. + """ + @property + def id(self) -> UniqueListenerId: + r""" + Returns the `UniqueListenerId` of the `Listener` + """ + def try_wait_one(self) -> typing.Optional[EventId]: + r""" + Non-blocking wait for a new `EventId`. If no `EventId` was notified it returns `None`. + On error it emits `ListenerWaitError`. + """ + def timed_wait_one(self, timeout:Duration) -> typing.Optional[EventId]: + r""" + Blocking wait for a new `EventId` until either an `EventId` was received or the timeout + has passed. If no `EventId` was notified it returns `None`. + On error it emits `ListenerWaitError`. + """ + def blocking_wait_one(self) -> typing.Optional[EventId]: + r""" + Blocking wait for a new `EventId`. + Sporadic wakeups can occur and if no `EventId` was notified it returns `None`. + On error it emits `ListenerWaitError`. + """ + def try_wait_all(self) -> builtins.list[EventId]: + r""" + Non-blocking wait for new `EventId`s. Collects all `EventId`s that were received and + calls the provided callback is with the `EventId` as input argument. + On error it emits `ListenerWaitError`. + """ + def timed_wait_all(self, timeout:Duration) -> builtins.list[EventId]: + r""" + Blocking wait for new `EventId`s until the provided timeout has passed. Unblocks as soon + as an `EventId` was received and then collects all `EventId`s that were received and + calls the provided callback is with the `EventId` as input argument. + On error it emits `ListenerWaitError`. + """ + def blocking_wait_all(self) -> builtins.list[EventId]: + r""" + Blocking wait for new `EventId`s. Unblocks as soon + as an `EventId` was received and then collects all `EventId`s that were received and + calls the provided callback is with the `EventId` as input argument. + On error it emits `ListenerWaitError`. + """ + def delete(self) -> None: + r""" + Releases the `Listener`. + + After this call the `Listener` is no longer usable! + """ + +class MessageTypeDetails: + r""" + Contains all type information to the header and payload type. + """ + @property + def header(self) -> TypeDetail: + r""" + The `TypeDetail` of the header of a message, the first iceoryx2 internal part. + """ + @property + def user_header(self) -> TypeDetail: + r""" + The `TypeDetail` of the user_header or the custom header, is located directly after the + header. + """ + @property + def payload(self) -> TypeDetail: + r""" + The `TypeDetail` of the payload of the message, the last part. + """ + +class Node: + r""" + All configurable settings of a `Node`. + """ + @property + def directory(self) -> Path: + r""" + The directory in which all node files are stored + """ + @property + def monitor_suffix(self) -> FileName: + r""" + The suffix of the monitor token + """ + @property + def static_config_suffix(self) -> FileName: + r""" + The suffix of the files where the node configuration is stored. + """ + @property + def service_tag_suffix(self) -> FileName: + r""" + The suffix of the service tags. + """ + @property + def cleanup_dead_nodes_on_creation(self) -> builtins.bool: + r""" + When true, the `NodeBuilder` checks for dead nodes and + cleans up all their stale resources whenever a new [`Node`](Node) is + created. + """ + @property + def cleanup_dead_nodes_on_destruction(self) -> builtins.bool: + r""" + When true, the `NodeBuilder` checks for dead nodes and + cleans up all their stale resources whenever an existing `Node` is + going out of scope. + """ + @directory.setter + def directory(self, value: Path) -> None: + r""" + Set the directory in which all node files are stored + """ + @monitor_suffix.setter + def monitor_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the monitor token + """ + @static_config_suffix.setter + def static_config_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the files where the node configuration is stored. + """ + @service_tag_suffix.setter + def service_tag_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the service tags. + """ + @cleanup_dead_nodes_on_creation.setter + def cleanup_dead_nodes_on_creation(self, value: builtins.bool) -> None: + r""" + Enable/disable the cleanup dead nodes on creation + """ + @cleanup_dead_nodes_on_destruction.setter + def cleanup_dead_nodes_on_destruction(self, value: builtins.bool) -> None: + r""" + Enable/disable the cleanup dead nodes on destruction + """ + def __str__(self) -> builtins.str: ... + +class Node: + r""" + The central entry point of iceoryx2. Represents a node of the iceoryx2 + system. One process can have arbitrary many nodes but usually it should be + only one node per process. + Can be created via the `NodeBuilder`. + """ + @property + def name(self) -> NodeName: + r""" + Returns the name of the node inside a `NodeName`. + """ + @property + def config(self) -> Config: + r""" + Returns the `Config` that the `Node` will use to create any iceoryx2 entity. + """ + @property + def id(self) -> NodeId: + r""" + Returns the unique id of the `Node`. + """ + @property + def signal_handling_mode(self) -> SignalHandlingMode: + r""" + Returns the `SignalHandlingMode` with which the `Node` was created. + """ + def __str__(self) -> builtins.str: ... + @staticmethod + def list(service_type:ServiceType, config:Config) -> builtins.list[NodeState]: + r""" + Returns a list of `NodeState`s of all `Node`s under a provided config. + On failure it emits a `NodeListFailure`. + """ + def service_builder(self, name:ServiceName) -> ServiceBuilder: + r""" + Instantiates a `ServiceBuilder` for a service with the provided name. + """ + def wait(self, cycle_time:Duration) -> None: + r""" + Waits for a given `cycle_time`. + On failure it emits a `NodeWaitFailure`. + """ + @staticmethod + def cleanup_dead_nodes(service_type:ServiceType, config:Config) -> CleanupState: + r""" + Removes the stale system resources of all dead `Node`s. The dead `Node`s are also + removed from all registered `Service`s. + + If a `Node` cannot be cleaned up since the process has insufficient permissions then + the `Node` is skipped. + """ + +class NodeBuilder: + r""" + Creates a new `Node`. + """ + @staticmethod + def new() -> NodeBuilder: + r""" + Instantiates a new `NodeBuilder` + """ + def name(self, value:NodeName) -> NodeBuilder: + r""" + The `NodeName` that shall be assigned to the `Node`. It does not + have to be unique. If no `NodeName` is defined then the `Node` + does not have a name. + """ + def signal_handling_mode(self, value:SignalHandlingMode) -> NodeBuilder: + r""" + Defines the `SignalHandlingMode` for the `Node`. It affects the `Node.wait()` call + that returns any received signal via its `NodeWaitFailure` + """ + def config(self, config:Config) -> NodeBuilder: + r""" + The `Config` that shall be used for the `Node`. If no `Config` + is specified the `config.global_config()` is used. + """ + def create(self, service_type:ServiceType) -> Node: + r""" + Creates a new `Node` for a specified `ServiceType`. + Emits `NodeCreationFailure` on failure. + """ + +class NodeDetails: + r""" + Contains details of a `Node`. + """ + @property + def executable(self) -> FileName: + r""" + Returns the executable `FileName` of the `Node`s owner process. + """ + @property + def name(self) -> NodeName: + r""" + Returns a reference of the `NodeName`. + """ + @property + def config(self) -> Config: + r""" + Returns a reference to the `Config` the `Node` uses. + """ + +class NodeId: + r""" + The system-wide unique id of a `Node` + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying integer value of the `NodeId`. + """ + @property + def pid(self) -> builtins.int: + r""" + Returns the process id of the process that owns the `Node`. + """ + def __eq__(self, other:NodeId) -> builtins.bool: ... + +class NodeName: + r""" + Represent the name for a `Node`. + """ + @staticmethod + def new(name:builtins.str) -> NodeName: + r""" + Creates a new `NodeName`. + If the provided name does not contain a valid `NodeName` it will emit + `SemanticStringError`, otherwise the `NodeName`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `NodeName` + """ + def as_str(self) -> builtins.str: + r""" + Converts the `NodeName` into a `String` + """ + +class NodeState: + r""" + Describes the state of a `Node`. + """ + class Alive(NodeState): + r""" + The `Node`s process is still alive. + """ + __match_args__ = ("_0",) + @property + def _0(self) -> AliveNodeView: ... + def __new__(cls, _0:AliveNodeView) -> NodeState.Alive: ... + def __len__(self) -> builtins.int: ... + def __getitem__(self, key:builtins.int) -> typing.Any: ... + + class Dead(NodeState): + r""" + The `Node`s process died without cleaning up the `Node`s resources. Another process has + now the responsibility to cleanup all the stale resources. + """ + __match_args__ = ("_0",) + @property + def _0(self) -> DeadNodeView: ... + def __new__(cls, _0:DeadNodeView) -> NodeState.Dead: ... + def __len__(self) -> builtins.int: ... + def __getitem__(self, key:builtins.int) -> typing.Any: ... + + class Inaccessible(NodeState): + r""" + The process does not have sufficient permissions to identify the `Node` as dead or alive. + """ + __match_args__ = ("_0",) + @property + def _0(self) -> NodeId: ... + def __new__(cls, _0:NodeId) -> NodeState.Inaccessible: ... + def __len__(self) -> builtins.int: ... + def __getitem__(self, key:builtins.int) -> typing.Any: ... + + class Undefined(NodeState): + r""" + The `Node` is in an undefined state, meaning that certain elements are missing, + misconfigured or inconsistent. This can only happen due to an implementation failure or + when the corresponding `Node` resources were altered. + """ + __match_args__ = ("_0",) + @property + def _0(self) -> NodeId: ... + def __new__(cls, _0:NodeId) -> NodeState.Undefined: ... + def __len__(self) -> builtins.int: ... + def __getitem__(self, key:builtins.int) -> typing.Any: ... + + ... + +class Notifier: + r""" + Represents the sending endpoint of an event based communication. + """ + @property + def id(self) -> UniqueNotifierId: + r""" + Returns the `UniqueNotifierId` of the `Notifier` + """ + @property + def deadline(self) -> typing.Optional[Duration]: + r""" + Returns the deadline of the corresponding `Service`. + """ + def notify(self) -> builtins.int: + r""" + Notifies all `Listener` connected to the service with the default + event id provided on creation. + Returns on success the number of `Listener`s that were notified otherwise it emits + `NotifierNotifyError`. + """ + def notify_with_custom_event_id(self, event_id:EventId) -> builtins.int: + r""" + Notifies all `Listener` connected to the service with a custom `EventId`. + Returns on success the number of `Listener`s that were notified otherwise it returns + `NotifierNotifyError`. + """ + def delete(self) -> None: + r""" + Releases the `Notifier`. + + After this call the `Notifier` is no longer usable! + """ + +class Path: + r""" + Relocatable (inter-process shared memory compatible) SemanticString implementation for + `Path`. All modification operations ensure that never an + invalid file or path name can be generated. All strings have a fixed size so that the maximum + path or file name length the system supports can be stored. + """ + @staticmethod + def new(name:builtins.str) -> Path: + r""" + Creates a new `Path` when the provided `name` contains a valid path, otherwise it emits a + `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `Path` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `Path` into a `String` + """ + +class PendingResponse: + r""" + Represents an active connection to all `Server` that received the `RequestMut`. The + `Client` can use it to receive the corresponding `Response`s. + + As soon as it goes out of scope, the connections are closed and the `Server`s are informed. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + def is_connected(self) -> builtins.bool: + r""" + Returns `True` until the `ActiveRequest` goes out of scope on the `Server`s side + indicating that the `Server` will no longer send `Response`s. + It also returns `False` when there are no `Server`. + """ + def header(self) -> RequestHeader: + r""" + Returns a reference to the iceoryx2 internal `RequestHeader` of the corresponding + `RequestMut` + """ + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user defined request header of the corresponding + `RequestMut` + """ + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the request payload of the corresponding + `RequestMut` + """ + def number_of_server_connections(self) -> builtins.int: + r""" + Returns how many `Server`s received the corresponding `RequestMut` initially. + """ + def has_response(self) -> builtins.bool: + r""" + Returns `True` when a `Server` has sent a `Response` otherwise `False`. + """ + def delete(self) -> None: + r""" + Releases the `PendingResponse` and signals the `Server` that the `Client` is no longer + interested in receiving any more `Response`s and terminates the connection. + + After this call the `PendingResponse` is no longer usable! + """ + def receive(self) -> typing.Optional[Response]: + r""" + Receives a `Response` from one of the `Server`s that received the `RequestMut`. + """ + +class PortFactoryClient: + r""" + Factory to create a new `Client` port/endpoint for `MessagingPattern::RequestResponse` + based communication. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + def unable_to_deliver_strategy(self, value:UnableToDeliverStrategy) -> PortFactoryClient: + r""" + Sets the `UnableToDeliverStrategy` which defines how the `Client` shall behave + when a `Server` cannot receive a `RequestMut` since its internal buffer is full. + """ + def __initial_max_slice_len(self, value:builtins.int) -> PortFactoryClient: + r""" + Sets the maximum slice length that a user can allocate with + `Client::loan_slice()` or `Client::loan_slice_uninit()`. + """ + def __allocation_strategy(self, value:AllocationStrategy) -> PortFactoryClient: + r""" + Defines the allocation strategy that is used when the provided + `PortFactoryClient::initial_max_slice_len()` is exhausted. This happens when the user + acquires more than max slice len in `Client::loan_slice()` or `Client::loan_slice_uninit()`. + """ + def create(self) -> Client: + r""" + Creates a new `Client` or emits a `ClientCreateError` on failure. + """ + +class PortFactoryEvent: + r""" + The factory for `MessagingPattern::Event`. It can acquire dynamic and static service + informations and create `Notifier` or `Listener` ports. + """ + @property + def name(self) -> ServiceName: + r""" + Returns the `ServiceName` of the service + """ + @property + def service_id(self) -> ServiceId: + r""" + Returns the `ServiceId` of the `Service` + """ + @property + def attributes(self) -> AttributeSet: + r""" + Returns the `AttributeSet` defined in the `Service` + """ + @property + def static_config(self) -> StaticConfigEvent: + r""" + Returns the StaticConfig of the `Service`. + Contains all settings that never change during the lifetime of the service. + """ + @property + def nodes(self) -> builtins.list[NodeState]: + r""" + Returns a list of all `NodeState` of all the `Node`s which have opened the `Service`. + """ + def listener_builder(self) -> PortFactoryListener: + r""" + Returns a `PortFactoryListener` to create a new `Listener` port + """ + def notifier_builder(self) -> PortFactoryNotifier: + r""" + Returns a `PortFactoryNotifier` to create a new `Notifier` port + """ + +class PortFactoryListener: + r""" + Factory to create a new `Listener` port/endpoint for `MessagingPattern::Event` based + communication. + """ + def create(self) -> Listener: + r""" + Creates the `Listener` port or emits a `ListenerCreateError` on failure. + """ + +class PortFactoryNotifier: + r""" + Factory to create a new `Notifier` port/endpoint for `MessagingPattern::Event` based + communication. + """ + def create(self) -> Notifier: + r""" + Creates a new `Notifier` port or emits a `NotifierCreateError` on failure. + """ + def default_event_id(self, value:EventId) -> PortFactoryNotifier: + r""" + Sets a default `EventId` for the `Notifier` that is used in `Notifier.notify()` + """ + +class PortFactoryPublishSubscribe: + r""" + The factory for `MessagingPattern::PublishSubscribe`. It can acquire dynamic and static service + informations and create `Publisher` or `Subscriber` ports. + """ + @property + def name(self) -> ServiceName: + r""" + Returns the `ServiceName` of the service + """ + @property + def service_id(self) -> ServiceId: + r""" + Returns the `ServiceId` of the `Service` + """ + @property + def attributes(self) -> AttributeSet: + r""" + Returns the `AttributeSet` defined in the `Service` + """ + @property + def static_config(self) -> StaticConfigPublishSubscribe: + r""" + Returns the StaticConfig of the `Service`. + Contains all settings that never change during the lifetime of the service. + """ + @property + def nodes(self) -> builtins.list[NodeState]: + r""" + Returns a list of all `NodeState` of all the `Node`s which have opened the `Service`. + """ + def publisher_builder(self) -> PortFactoryPublisher: + r""" + Returns a `PortFactoryPublisher` to create a new `Publisher` port + """ + def subscriber_builder(self) -> PortFactorySubscriber: + r""" + Returns a `PortFactorySubscriber` to create a new `Subscriber` port + """ + +class PortFactoryPublisher: + r""" + Factory to create a new `Publisher` port/endpoint for `MessagingPattern::PublishSubscribe` + based communication. + """ + @property + def __payload_type_details(self) -> typing.Optional[typing.Any]: ... + def max_loaned_samples(self, value:builtins.int) -> PortFactoryPublisher: + r""" + Defines how many `SampleMut` the `Publisher` can loan with `Publisher::loan()` or + `Publisher::loan_uninit()` in parallel. + """ + def unable_to_deliver_strategy(self, value:UnableToDeliverStrategy) -> PortFactoryPublisher: + r""" + Sets the `UnableToDeliverStrategy`. + """ + def __initial_max_slice_len(self, value:builtins.int) -> PortFactoryPublisher: + r""" + Sets the maximum slice length that a user can allocate with + `ActiveRequest::loan_slice()` or `ActiveRequest::loan_slice_uninit()`. + """ + def __allocation_strategy(self, value:AllocationStrategy) -> PortFactoryPublisher: + r""" + Defines the allocation strategy that is used when the provided + `PortFactoryServer::initial_max_slice_len()` is exhausted. This happens when the user + acquires more than max slice len in `ActiveRequest::loan_slice()` or + `ActiveRequest::loan_slice_uninit()`. + """ + def create(self) -> Publisher: + r""" + Creates a new `Publisher` or emits a `PublisherCreateError` on failure. + """ + +class PortFactoryRequestResponse: + r""" + The factory for `MessagingPattern::RequestResponse`. It can acquire dynamic and static service + informations and create `Client` or `Server` ports. + """ + @property + def name(self) -> ServiceName: + r""" + Returns the `ServiceName` of the service + """ + @property + def service_id(self) -> ServiceId: + r""" + Returns the `ServiceId` of the `Service` + """ + @property + def attributes(self) -> AttributeSet: + r""" + Returns the `AttributeSet` defined in the `Service` + """ + @property + def static_config(self) -> StaticConfigRequestResponse: + r""" + Returns the StaticConfig of the `Service`. + Contains all settings that never change during the lifetime of the service. + """ + @property + def nodes(self) -> builtins.list[NodeState]: + r""" + Returns a list of all `NodeState` of all the `Node`s which have opened the `Service`. + """ + def server_builder(self) -> PortFactoryServer: + r""" + Returns a `PortFactoryServer` to create a new `Server` port + """ + def client_builder(self) -> PortFactoryClient: + r""" + Returns a `PortFactoryClient` to create a new `Client` port + """ + +class PortFactoryServer: + r""" + Factory to create a new `Server` port/endpoint for `MessagingPattern::RequestResponse` based + communication. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + def unable_to_deliver_strategy(self, value:UnableToDeliverStrategy) -> PortFactoryServer: + r""" + Sets the `UnableToDeliverStrategy` which defines how the `Server` shall behave + when a `Client` cannot receive a `Response` since its internal buffer is full. + """ + def max_loaned_responses_per_request(self, value:builtins.int) -> PortFactoryServer: + r""" + Defines the maximum number of `ResponseMut` that + the `Server` can loan in parallel per + `ActiveRequest`. + """ + def __initial_max_slice_len(self, value:builtins.int) -> PortFactoryServer: + r""" + Sets the maximum slice length that a user can allocate with + `ActiveRequest::loan_slice()` or `ActiveRequest::loan_slice_uninit()`. + """ + def __allocation_strategy(self, value:AllocationStrategy) -> PortFactoryServer: + r""" + Defines the allocation strategy that is used when the provided + `PortFactoryServer::initial_max_slice_len()` is exhausted. This happens when the user + acquires more than max slice len in `ActiveRequest::loan_slice()` or + `ActiveRequest::loan_slice_uninit()`. + """ + def create(self) -> Server: + r""" + Creates a new `Server` or emits a `ServerCreateError` on failure. + """ + +class PortFactorySubscriber: + r""" + Factory to create a new `Subscriber` port/endpoint for + `MessagingPattern::PublishSubscribe` based communication. + """ + def buffer_size(self, value:builtins.int) -> PortFactorySubscriber: + r""" + Defines the buffer size of the `Subscriber`. Smallest possible value is `1`. + """ + def create(self) -> Subscriber: + r""" + Creates a new `Subscriber` or emits a `SubscriberCreateError` on failure. + """ + +class PublishSubscribe: + r""" + Default settings for the publish-subscribe messaging pattern. These settings are used unless + the user specifies custom QoS or port settings. + """ + @property + def max_subscribers(self) -> builtins.int: + r""" + The maximum amount of supported `Subscriber`s + """ + @property + def max_publishers(self) -> builtins.int: + r""" + The maximum amount of supported `Publisher`s + """ + @property + def max_nodes(self) -> builtins.int: + r""" + The maximum amount of supported `Node`s. Defines indirectly how many + processes can open the service at the same time. + """ + @property + def subscriber_max_buffer_size(self) -> builtins.int: + r""" + The maximum buffer size a `Subscriber` can have + """ + @property + def subscriber_max_borrowed_samples(self) -> builtins.int: + r""" + The maximum amount of `Sample`s a `Subscriber` can hold at the same time. + """ + @property + def publisher_max_loaned_samples(self) -> builtins.int: + r""" + The maximum amount of `SampleMut`s a `Publisher` can loan at the same time. + """ + @property + def publisher_history_size(self) -> builtins.int: + r""" + The maximum history size a `Subscriber` can request from a `Publisher`. + """ + @property + def enable_safe_overflow(self) -> builtins.bool: + r""" + Defines how the `Subscriber` buffer behaves when it is + full. When safe overflow is activated, the `Publisher` will + replace the oldest `Sample` with the newest one. + """ + @property + def unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + If safe overflow is deactivated it defines the deliver strategy of the + `Publisher` when the `Subscriber`s buffer is full. + """ + @property + def subscriber_expired_connection_buffer(self) -> builtins.int: + r""" + Defines the size of the internal `Subscriber` + buffer that contains expired connections. An + connection is expired when the `Publisher` + disconnected from a service and the connection + still contains unconsumed `Sample`s. + """ + @max_subscribers.setter + def max_subscribers(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Subscriber`s + """ + @max_publishers.setter + def max_publishers(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Publisher`s + """ + @max_nodes.setter + def max_nodes(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Node`s. + """ + @subscriber_max_buffer_size.setter + def subscriber_max_buffer_size(self, value: builtins.int) -> None: + r""" + Set the maximum buffer size a `Subscriber` can have + """ + @subscriber_max_borrowed_samples.setter + def subscriber_max_borrowed_samples(self, value: builtins.int) -> None: + r""" + Set the maximum amount of `Sample`s a `Subscriber` can hold at the same time. + """ + @publisher_max_loaned_samples.setter + def publisher_max_loaned_samples(self, value: builtins.int) -> None: + r""" + The maximum amount of `SampleMut`s a `Publisher` can loan at the same time. + """ + @publisher_history_size.setter + def publisher_history_size(self, value: builtins.int) -> None: + r""" + Set the maximum history size a `Subscriber` can request from a `Publisher`. + """ + @enable_safe_overflow.setter + def enable_safe_overflow(self, value: builtins.bool) -> None: + r""" + Enables/disables safe overflow + """ + @unable_to_deliver_strategy.setter + def unable_to_deliver_strategy(self, value: UnableToDeliverStrategy) -> None: + r""" + Define the unable to deliver strategy + """ + @subscriber_expired_connection_buffer.setter + def subscriber_expired_connection_buffer(self, value: builtins.int) -> None: + r""" + Set the expired connection buffer size + """ + def __str__(self) -> builtins.str: ... + +class Publisher: + r""" + Represents the receiving endpoint of an event based communication. + """ + @property + def __payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def id(self) -> UniquePublisherId: + r""" + Returns the `UniquePublisherId` of the `Publisher` + """ + @property + def unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + Returns the strategy the `Publisher` follows when a `SampleMut` cannot be delivered + since the `Subscriber`s buffer is full. + """ + @property + def initial_max_slice_len(self) -> builtins.int: + r""" + Returns the maximum initial slice length configured for this `Publisher`. + """ + def __loan_uninit(self) -> SampleMutUninit: + r""" + Loans/allocates a `SampleMutUninit` from the underlying data segment of the `Publisher`. + The user has to initialize the payload before it can be sent. + + On failure it returns `LoanError` describing the failure. + """ + def __loan_slice_uninit(self, number_of_elements:builtins.int) -> SampleMutUninit: + r""" + Loans/allocates a `SampleMutUninit` from the underlying data segment of the `Publisher`. + The user has to initialize the payload before it can be sent. + Fails when it is called for data types which are not a slice. + + On failure it returns `LoanError` describing the failure. + """ + def delete(self) -> None: + r""" + Releases the `Publisher`. + + After this call the `Publisher` is no longer usable! + """ + +class RequestHeader: + r""" + Request header used by `MessagingPattern::RequestResponse` + """ + @property + def client_id(self) -> UniqueClientId: + r""" + Returns the `UniqueClientId` of the `Client` which sent the `RequestMut` + """ + @property + def number_of_elements(self) -> builtins.int: + r""" + Returns how many elements are stored inside the requests's payload. + """ + +class RequestMut: + r""" + The `RequestMut` represents the object that contains the payload that the `Client` sends to the + `Server`. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> RequestHeader: + r""" + Returns the iceoryx2 internal `RequestHeader` + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user defined request header. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user defined request payload. + """ + def delete(self) -> None: + r""" + Releases the `RequestMut`. + + After this call the `RequestMut` is no longer usable! + """ + def send(self) -> PendingResponse: + r""" + Sends the `RequestMut` to all connected `Server`s of the `Service`. + """ + +class RequestMutUninit: + r""" + A version of the `RequestMut` where the payload is not initialized which allows + true zero copy usage. To send a `RequestMutUninit` it must be first initialized + and converted into `RequestMut` with `RequestMutUninit::assume_init()`. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> RequestHeader: + r""" + Returns the iceoryx2 internal `RequestHeader` + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user defined request header. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user defined request payload. + """ + def delete(self) -> None: + r""" + Releases the `RequestMutUninit`. + + After this call the `RequestMutUninit` is no longer usable! + """ + def assume_init(self) -> RequestMut: + r""" + When the payload is manually populated by using + `RequestMutUninit::payload_ptr()`, then this function can be used + to convert it into the initialized `RequestMut` version. + """ + +class RequestResponse: + r""" + Default settings for the request response messaging pattern. These settings are used unless + the user specifies custom QoS or port settings. + """ + @property + def enable_safe_overflow_for_requests(self) -> builtins.bool: + r""" + Defines if the request buffer of the `Service` safely overflows. + """ + @property + def enable_safe_overflow_for_responses(self) -> builtins.bool: + r""" + Defines if the response buffer of the `Service` safely overflows. + """ + @property + def max_active_requests_per_client(self) -> builtins.int: + r""" + The maximum of `ActiveRequest`s a `Server` can hold in + parallel per `Client`. + """ + @property + def max_response_buffer_size(self) -> builtins.int: + r""" + The maximum buffer size for `Response`s for a + `PendingResponse`. + """ + @property + def max_servers(self) -> builtins.int: + r""" + The maximum amount of supported `Server` + """ + @property + def max_clients(self) -> builtins.int: + r""" + The maximum amount of supported `Client` + """ + @property + def max_nodes(self) -> builtins.int: + r""" + The maximum amount of supported `Node`s. Defines + indirectly how many processes can open the service at the same time. + """ + @property + def max_borrowed_responses_per_pending_response(self) -> builtins.int: + r""" + The maximum amount of borrowed `Response` per + `PendingResponse` on the `Client` side. + """ + @property + def max_loaned_requests(self) -> builtins.int: + r""" + Defines how many `RequestMut` a + `Client` can loan in parallel. + """ + @property + def server_max_loaned_responses_per_request(self) -> builtins.int: + r""" + Defines how many `ResponseMut` a `Server` can loan in + parallel per `ActiveRequest`. + """ + @property + def client_unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + Defines the `UnableToDeliverStrategy` when a `Client` + could not deliver the request to the `Server`. + """ + @property + def server_unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + Defines the `UnableToDeliverStrategy` when a `Server` + could not deliver the response to the `Client`. + """ + @property + def client_expired_connection_buffer(self) -> builtins.int: + r""" + Defines the size of the internal `Client` + buffer that contains expired connections. An + connection is expired when the `Server` + disconnected from a service and the connection + still contains unconsumed `Response`s. + """ + @property + def server_expired_connection_buffer(self) -> builtins.int: + r""" + Defines the size of the internal `Server` + buffer that contains expired connections. An + connection is expired when the `Client` + disconnected from a service and the connection + still contains unconsumed `ActiveRequest`s. + """ + @property + def enable_fire_and_forget_requests(self) -> builtins.bool: + r""" + Allows the `Server` to receive `RequestMut`s of `Client`s that are not interested in a + `Response`, meaning that the `Server` will receive the `RequestMut` despite the + corresponding `PendingResponse` already went out-of-scope. So any `Response` sent by the + `Server` would not be received by the corresponding `Client`s `PendingResponse`. + + Consider enabling this feature if you do not want to loose any `RequestMut`. + """ + @enable_safe_overflow_for_requests.setter + def enable_safe_overflow_for_requests(self, value: builtins.bool) -> None: + r""" + Enables/disables safe overflow for the request buffer. + """ + @enable_safe_overflow_for_responses.setter + def enable_safe_overflow_for_responses(self, value: builtins.bool) -> None: + r""" + Enables/disables safe overflow for the response buffer. + """ + @max_active_requests_per_client.setter + def max_active_requests_per_client(self, value: builtins.int) -> None: + r""" + Set the maximum of `ActiveRequest`s a `Server` can hold in + parallel per `Client`. + """ + @max_response_buffer_size.setter + def max_response_buffer_size(self, value: builtins.int) -> None: + r""" + Set the maximum buffer size for `Response`s for a + `PendingResponse`. + """ + @max_servers.setter + def max_servers(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Server` + """ + @max_clients.setter + def max_clients(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Client` + """ + @max_nodes.setter + def max_nodes(self, value: builtins.int) -> None: + r""" + Set the maximum amount of supported `Node`s. Defines + indirectly how many processes can open the service at the same time. + """ + @max_borrowed_responses_per_pending_response.setter + def max_borrowed_responses_per_pending_response(self, value: builtins.int) -> None: + r""" + Set the maximum amount of borrowed `Response` per + `PendingResponse` on the `Client` side. + """ + @max_loaned_requests.setter + def max_loaned_requests(self, value: builtins.int) -> None: + r""" + Set how many `RequestMut` a + `Client` can loan in parallel. + """ + @server_max_loaned_responses_per_request.setter + def server_max_loaned_responses_per_request(self, value: builtins.int) -> None: + r""" + Set how many `ResponseMut` a `Server` can loan in + parallel per `ActiveRequest`. + """ + @client_unable_to_deliver_strategy.setter + def client_unable_to_deliver_strategy(self, value: UnableToDeliverStrategy) -> None: + r""" + Set the `UnableToDeliverStrategy` when a `Client` + could not deliver the request to the `Server`. + """ + @server_unable_to_deliver_strategy.setter + def server_unable_to_deliver_strategy(self, value: UnableToDeliverStrategy) -> None: + r""" + Set the `UnableToDeliverStrategy` when a `Server` + could not deliver the response to the `Client`. + """ + @client_expired_connection_buffer.setter + def client_expired_connection_buffer(self, value: builtins.int) -> None: + r""" + Set the size of the internal `Client` + buffer that contains expired connections. An + connection is expired when the `Server` + disconnected from a service and the connection + still contains unconsumed `Response`s. + """ + @server_expired_connection_buffer.setter + def server_expired_connection_buffer(self, value: builtins.int) -> None: + r""" + Set the size of the internal `Server` + buffer that contains expired connections. An + connection is expired when the `Client` + disconnected from a service and the connection + still contains unconsumed `ActiveRequest`s. + """ + @enable_fire_and_forget_requests.setter + def enable_fire_and_forget_requests(self, value: builtins.bool) -> None: + r""" + Set if fire-and-forget feature is enabled + """ + def __str__(self) -> builtins.str: ... + +class Response: + r""" + It stores the payload and can be received by the `PendingResponse` after a `RequestMut` was + sent to a `Server` via the `Client`. + """ + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> ResponseHeader: + r""" + Returns the `ResponseHeader` + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header of the response. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload of the response. + """ + @property + def origin(self) -> UniqueServerId: + r""" + Returns the `UniqueServerId` of the `Server` which sent the `Response`. + """ + def delete(self) -> None: + r""" + Releases the `Response`. + + After this call the `Response` is no longer usable! + """ + +class ResponseHeader: + r""" + Response header used by `MessagingPattern::RequestResponse` + """ + @property + def server_id(self) -> UniqueServerId: + r""" + Returns the `UniqueServerId` of the `Server` which sent the `Response` + """ + @property + def number_of_elements(self) -> builtins.int: + r""" + Returns how many elements are stored inside the `Response`s payload. + """ + +class ResponseMut: + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> ResponseHeader: + r""" + Returns a reference to the `ResponseHeader`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header of the response. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload of the response. + """ + def delete(self) -> None: + r""" + Releases the `ResponseMut`. + + After this call the `ResponseMut` is no longer usable! + """ + def send(self) -> None: + r""" + Sends a `ResponseMut` to the corresponding `PendingResponse` of the + `Client`. + """ + +class ResponseMutUninit: + r""" + Acquired by a `ActiveRequest` with + * `ActiveRequest::loan_uninit()` + + It stores the payload of the response that will be sent to the corresponding + `PendingResponse` of the `Client`. + + If the `ResponseMutUninit` is not sent it will reelase the loaned memory when going out of + scope. + """ + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> ResponseHeader: + r""" + Returns a reference to the `ResponseHeader`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header of the response. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload of the response. + """ + def delete(self) -> None: + r""" + Releases the `ResponseMutUninit`. + + After this call the `ResponseMutUninit` is no longer usable! + """ + def assume_init(self) -> ResponseMut: + r""" + Converts the `ResponseMutUninit` into `ResponseMut`. This shall be done after the + payload was written into the `ResponseMutUninit`. + """ + +class Sample: + r""" + It stores the payload and is acquired by the `Subscriber` whenever + it receives new data from a `Publisher` via `Subscriber::receive()`. + """ + @property + def __payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __user_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> HeaderPublishSubscribe: + r""" + Returns the `HeaderPublishSubscribe` of the `Sample`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload. + """ + def delete(self) -> None: + r""" + Releases the `Sample`. + + After this call the `Sample` is no longer usable! + """ + +class SampleMut: + r""" + Acquired by a `Publisher` via + * `Publisher::loan()`, + * `Publisher::loan_slice()` + + It stores the payload that will be sent + to all connected `Subscriber`s. If the `SampleMut` is not sent + it will release the loaned memory when going out of scope. + """ + @property + def __payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __user_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> HeaderPublishSubscribe: + r""" + Returns the `HeaderPublishSubscribe` of the `Sample`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload. + """ + def delete(self) -> None: + r""" + Releases the `SampleMut`. + + After this call the `SampleMut` is no longer usable! + """ + def send(self) -> builtins.int: + r""" + Send a previously loaned `Publisher::loan_uninit()` `SampleMut` to all connected + `Subscriber`s of the service. + + On success the number of `Subscriber`s that received + the data is returned, otherwise a `SendError` is emitted describing the failure. + """ + +class SampleMutUninit: + r""" + Acquired by a `Publisher` via + * `Publisher::loan_uninit()` + + It stores the payload that will be sent + to all connected `Subscriber`s. If the `SampleMut` is not sent + it will release the loaned memory when going out of scope. + """ + @property + def __payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __user_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __slice_len(self) -> builtins.int: ... + @property + def header(self) -> HeaderPublishSubscribe: + r""" + Returns the `HeaderPublishSubscribe` of the `Sample`. + """ + @property + def user_header_ptr(self) -> builtins.int: + r""" + Returns a pointer to the user header. + """ + @property + def payload_ptr(self) -> builtins.int: + r""" + Returns a pointer to the payload. + """ + def delete(self) -> None: + r""" + Releases the `SampleMutUninit`. + + After this call the `SampleMutUninit` is no longer usable! + """ + def assume_init(self) -> SampleMut: + r""" + Extracts the value of the uninitialized payload and labels the `SampleMutUninit` as + initialized `SampleMut` + + After this call the `SampleMutUninit` is no longer usable! + """ + +class Server: + r""" + Represents the receiving endpoint of an event based communication. + """ + @property + def __request_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __request_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_payload_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def __response_header_type_details(self) -> typing.Optional[typing.Any]: ... + @property + def id(self) -> UniqueServerId: + r""" + Returns the `UniqueServerId` of the `Server` + """ + @property + def has_requests(self) -> builtins.bool: + r""" + Returns true if the `Server` has `RequestMut`s in its buffer. + """ + @property + def __initial_max_slice_len(self) -> builtins.int: + r""" + Returns the maximum initial slice length configured for this `Server`. + """ + @property + def unable_to_deliver_strategy(self) -> UnableToDeliverStrategy: + r""" + Returns the strategy the `Server` follows when a `ResponseMut` cannot be delivered + if the `Client`s buffer is full. + """ + def receive(self) -> typing.Optional[ActiveRequest]: + r""" + Receives a `RequestMut` that was sent by a `Client` and returns an `ActiveRequest` + which can be used to respond. If no `RequestMut`s were received it returns `None`. + """ + def delete(self) -> None: + r""" + Releases the `Server`. + + After this call the `Server` is no longer usable! + """ + +class Service: + r""" + All configurable settings of a `Service`. + """ + @property + def directory(self) -> Path: + r""" + The directory in which all service files are stored + """ + @property + def data_segment_suffix(self) -> FileName: + r""" + The suffix of the ports data segment + """ + @property + def static_config_storage_suffix(self) -> FileName: + r""" + The suffix of the static config file + """ + @property + def dynamic_config_storage_suffix(self) -> FileName: + r""" + The suffix of the dynamic config file + """ + @property + def creation_timeout(self) -> Duration: + r""" + Defines the time of how long another process will wait until the service creation is + finalized + """ + @property + def connection_suffix(self) -> FileName: + r""" + The suffix of a one-to-one connection + """ + @property + def event_connection_suffix(self) -> FileName: + r""" + The suffix of a one-to-one connection + """ + @directory.setter + def directory(self, value: Path) -> None: + r""" + Set the directory in which all service files are stored + """ + @data_segment_suffix.setter + def data_segment_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the ports data segment + """ + @static_config_storage_suffix.setter + def static_config_storage_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the static config file + """ + @dynamic_config_storage_suffix.setter + def dynamic_config_storage_suffix(self, value: FileName) -> None: + r""" + Set the suffix of the dynamic config file + """ + @creation_timeout.setter + def creation_timeout(self, value: Duration) -> None: + r""" + Set the creation timeout + """ + @connection_suffix.setter + def connection_suffix(self, value: FileName) -> None: + r""" + Set the suffix of a one-to-one connection + """ + @event_connection_suffix.setter + def event_connection_suffix(self, value: FileName) -> None: + r""" + Set the suffix of a one-to-one connection + """ + def __str__(self) -> builtins.str: ... + +class Service: + r""" + Builder to create or open `Service`s + """ + @staticmethod + def does_exist(service_name:ServiceName, config:Config, messaging_pattern:MessagingPattern, service_type:ServiceType) -> builtins.bool: + r""" + Checks if a service under a given `Config` does exist + """ + @staticmethod + def details(service_name:ServiceName, config:Config, messaging_pattern:MessagingPattern, service_type:ServiceType) -> typing.Optional[ServiceDetails]: + r""" + Acquires the `ServiceDetails` of a `Service`. + """ + @staticmethod + def list(config:Config, service_type:ServiceType) -> builtins.list[ServiceDetails]: + r""" + Returns a list of all services created under a given `Config`. + """ + +class ServiceBuilder: + r""" + Builder to create or open `Service`s + """ + def event(self) -> ServiceBuilderEvent: + r""" + Create a new builder to create a `MessagingPattern::Event` `Service`. + """ + def __publish_subscribe(self) -> ServiceBuilderPublishSubscribe: + r""" + Create a new builder to create a `MessagingPattern::PublishSubscribe` `Service`. + """ + def __request_response(self) -> ServiceBuilderRequestResponse: + r""" + Create a new builder to create a `MessagingPattern::RequestResponse` `Service`. + """ + +class ServiceBuilderEvent: + r""" + Builder to create new `MessagingPattern::Event` based `Service`s + """ + def deadline(self, deadline:Duration) -> ServiceBuilderEvent: + r""" + Enables the deadline property of the service. There must be a notification emitted by any + `Notifier` after at least the provided `deadline`. + """ + def disable_deadline(self) -> ServiceBuilderEvent: + r""" + Disables the deadline property of the service. `Notifier` can signal notifications at any + rate. + """ + def max_nodes(self, value:builtins.int) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines how many `Node`s shall be able to open it in + parallel. If an existing `Service` is opened it defines how many `Node`s must be at least + supported. + """ + def event_id_max_value(self, value:builtins.int) -> ServiceBuilderEvent: + r""" + If the `Service` is created it set the greatest supported `NodeId` value + If an existing `Service` is opened it defines the value size the `NodeId` + must at least support. + """ + def max_notifiers(self, value:builtins.int) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines how many `Notifier` shall be supported at most. If + an existing `Service` is opened it defines how many `Notifier` must be at least supported. + """ + def max_listeners(self, value:builtins.int) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines how many `Listener` shall be supported at most. If + an existing `Service` is opened it defines how many `Listener` must be at least supported. + """ + def notifier_created_event(self, value:EventId) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines the event that shall be emitted by every newly + created `Notifier`. + """ + def disable_notifier_created_event(self) -> ServiceBuilderEvent: + r""" + If the `Service` is created it disables the event that shall be emitted by every newly + created `Notifier`. + """ + def notifier_dropped_event(self, value:EventId) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines the event that shall be emitted by every + `Notifier` before it is dropped. + """ + def disable_notifier_dropped_event(self) -> ServiceBuilderEvent: + r""" + If the `Service` is created it disables the event that shall be emitted by every + `Notifier` before it is dropped. + """ + def notifier_dead_event(self, value:EventId) -> ServiceBuilderEvent: + r""" + If the `Service` is created it defines the event that shall be emitted when a + `Notifier` is identified as dead. + """ + def disable_notifier_dead_event(self) -> ServiceBuilderEvent: + r""" + If the `Service` is created it disables the event that shall be emitted when a + `Notifier` is identified as dead. + """ + def open_or_create(self) -> PortFactoryEvent: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be + created. On failure it emits an `EventOpenOrCreateError` + """ + def open_or_create_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryEvent: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be + created. It defines a set of attributes. If the `Service` already exists all attribute + requirements must be satisfied otherwise the open process will fail. If the `Service` + does not exist the required attributes will be defined in the `Service`. + Emits and `EventOpenOrCreateError` on failure. + """ + def open(self) -> PortFactoryEvent: + r""" + Opens an existing `Service`. Emits an `EventOpenError` on failure. + """ + def open_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryEvent: + r""" + Opens an existing `Service` with attribute requirements. If the defined attribute + requirements are not satisfied the open process will fail. Emits an `EventOpenError` + on failure. + """ + def create(self) -> PortFactoryEvent: + r""" + Creates a new `Service`. + """ + def create_with_attributes(self, attributes:AttributeSpecifier) -> PortFactoryEvent: + r""" + Creates a new `Service` with a set of attributes. + """ + +class ServiceBuilderPublishSubscribe: + r""" + Builder to create new `MessagingPattern::PublishSubscribe` based `Service`s + """ + def __set_payload_type(self, value:typing.Any) -> None: ... + def __set_user_header_type(self, value:typing.Any) -> None: ... + def __payload_type_details(self, value:TypeDetail) -> ServiceBuilderPublishSubscribe: + r""" + Defines the payload type. To be able to connect to a `Service` the `TypeDetail` must be + identical in all participants since the communication is always strongly typed. + """ + def __user_header_type_details(self, value:TypeDetail) -> ServiceBuilderPublishSubscribe: + r""" + Defines the user header type. To be able to connect to a `Service` the `TypeDetail` must be + identical in all participants since the communication is always strongly typed. + """ + def payload_alignment(self, value:Alignment) -> ServiceBuilderPublishSubscribe: + r""" + Overrides and increases the alignment of the payload - useful when the payload is used in + SIMD operations. To be able to connect to a `Service` the payload alignment must be + identical in all participants since the communication is always strongly typed. + """ + def enable_safe_overflow(self, value:builtins.bool) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created, defines the overflow behavior of the service. If an existing + `Service` is opened it requires the service to have the defined overflow behavior. + """ + def subscriber_max_borrowed_samples(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines how many `Sample`s a + `Subscriber` can borrow at most in parallel. If an existing + `Service` is opened it defines the minimum required. + """ + def history_size(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines the maximum history size a `Subscriber` can request + on connection. If an existing `Service` is opened it defines the minimum required. + """ + def subscriber_max_buffer_size(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines how many `Sample` a `Subscriber` can store in its + internal buffer. If an existing `Service` is opened it defines the minimum required. + """ + def max_subscribers(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines how many `Subscriber` shall be supported at + most. If an existing `Service` is opened it defines how many `Subscriber` must be at + least supported. + """ + def max_publishers(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines how many `Publisher` shall be supported at + most. If an existing `Service` is opened it defines how many `Publisher` must be at + least supported. + """ + def max_nodes(self, value:builtins.int) -> ServiceBuilderPublishSubscribe: + r""" + If the `Service` is created it defines how many `Node`s shall be able to open it in + parallel. If an existing `Service` is opened it defines how many `Node`s must be at + least supported. + """ + def open_or_create(self) -> PortFactoryPublishSubscribe: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be created. + On failure it emits `PublishSubscribeOpenOrCreateError` + """ + def open_or_create_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryPublishSubscribe: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be + created. It defines a set of attributes. If the `Service` already exists all attribute + requirements must be satisfied otherwise the open process will fail. If the `Service` + does not exist the required attributes will be defined in the `Service`. + On failure it emits `PublishSubscribeOpenOrCreateError` + """ + def open(self) -> PortFactoryPublishSubscribe: + r""" + Opens an existing `Service`. + On failure it emits `PublishSubscribeOpenError`. + """ + def open_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryPublishSubscribe: + r""" + Opens an existing `Service` with attribute requirements. If the defined attribute + requirements are not satisfied the open process will fail. + On failure it emits `PublishSubscribeOpenError`. + """ + def create(self) -> PortFactoryPublishSubscribe: + r""" + Creates a new `Service`. + On failure it emits `PublishSubscribeCreateError`. + """ + def create_with_attributes(self, attributes:AttributeSpecifier) -> PortFactoryPublishSubscribe: + r""" + Creates a new `Service` with a set of attributes. + On failure it emits `PublishSubscribeCreateError`. + """ + +class ServiceBuilderRequestResponse: + r""" + Builder to create new `MessagingPattern::RequestResponse` based `Service`s + """ + def __set_request_payload_type(self, value:typing.Any) -> None: ... + def __set_response_payload_type(self, value:typing.Any) -> None: ... + def __set_request_header_type(self, value:typing.Any) -> None: ... + def __set_response_header_type(self, value:typing.Any) -> None: ... + def __request_payload_type_details(self, value:TypeDetail) -> ServiceBuilderRequestResponse: + r""" + Defines the payload type for requests. To be able to connect to a `Service` the + `TypeDetail` must be identical in all participants since the communication is always + strongly typed. + """ + def __request_header_type_details(self, value:TypeDetail) -> ServiceBuilderRequestResponse: + r""" + Defines the request header type. To be able to connect to a `Service` the `TypeDetail` must + be identical in all participants since the communication is always strongly typed. + """ + def __response_payload_type_details(self, value:TypeDetail) -> ServiceBuilderRequestResponse: + r""" + Defines the payload type for responses. To be able to connect to a `Service` the + `TypeDetail` must be identical in all participants since the communication is always + strongly typed. + """ + def __response_header_type_details(self, value:TypeDetail) -> ServiceBuilderRequestResponse: + r""" + Defines the response header type. To be able to connect to a `Service` the `TypeDetail` + must be identical in all participants since the communication is always strongly typed. + """ + def request_payload_alignment(self, value:Alignment) -> ServiceBuilderRequestResponse: + r""" + Overrides and increases the alignment of the request payload - useful when the payload is + used in SIMD operations. To be able to connect to a `Service` the payload alignment must be + identical in all participants since the communication is always strongly typed. + """ + def response_payload_alignment(self, value:Alignment) -> ServiceBuilderRequestResponse: + r""" + Overrides and increases the alignment of the response payload - useful when the payload is + used in SIMD operations. To be able to connect to a `Service` the payload alignment must be + identical in all participants since the communication is always strongly typed. + """ + def enable_safe_overflow_for_requests(self, value:builtins.bool) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created, defines the overflow behavior of the service for requests. + If an existing `Service` is opened it requires the service to have the defined overflow + behavior. + """ + def enable_safe_overflow_for_responses(self, value:builtins.bool) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created, defines the overflow behavior of the service for responses. + If an existing `Service` is opened it requires the service to have the defined overflow + behavior. + """ + def enable_fire_and_forget_requests(self, value:builtins.bool) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created, defines the fire-and-forget behavior of the service for + requests. + """ + def max_active_requests_per_client(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + Defines how many active requests a `Server` can hold in + parallel per `Client`. The objects are used to send answers to a request that was + received earlier from a `Client`. + """ + def max_loaned_requests(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many `RequestMut` a + `Client` can loan in parallel. + """ + def max_response_buffer_size(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many responses fit in the + `Clients`s buffer. If an existing `Service` is opened it defines the minimum required. + """ + def max_servers(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many `Server`s shall + be supported at most. If an existing `Service` is opened it defines how many + `Server`s must be at least supported. + """ + def max_clients(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many `Client`s shall + be supported at most. If an existing `Service` is opened it defines how many + `Client`s must be at least supported. + """ + def max_nodes(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many `Node`s shall + be able to open it in parallel. If an existing `Service` is opened it defines how many + `Node`s must be at least supported. + """ + def max_borrowed_responses_per_pending_response(self, value:builtins.int) -> ServiceBuilderRequestResponse: + r""" + If the `Service` is created it defines how many `Response`s shall + be able to be borrowed in parallel per `PendingResponse`. If an + existing `Service` is opened it defines how many borrows must be at least supported. + """ + def open_or_create(self) -> PortFactoryRequestResponse: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be created. + On failure `RequestResponseOpenOrCreateError` will be emitted. + """ + def open_or_create_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryRequestResponse: + r""" + If the `Service` exists, it will be opened otherwise a new `Service` will be + created. It defines a set of attributes. + + If the `Service` already exists all attribute requirements must be satisfied, + and service payload type must be the same, otherwise the open process will fail. + If the `Service` does not exist the required attributes will be defined in the `Service`. + On failure `RequestResponseOpenOrCreateError` will be emitted. + """ + def open(self) -> PortFactoryRequestResponse: + r""" + Opens an existing `Service`. + On failure `RequestResponseOpenError` will be emitted. + """ + def open_with_attributes(self, verifier:AttributeVerifier) -> PortFactoryRequestResponse: + r""" + Opens an existing `Service` with attribute requirements. If the defined attribute + requirements are not satisfied the open process will fail. + On failure `RequestResponseOpenError` will be emitted. + """ + def create(self) -> PortFactoryRequestResponse: + r""" + Creates a new `Service`. + On failure `RequestResponseCreateError` will be emitted. + """ + def create_with_attributes(self, attributes:AttributeSpecifier) -> PortFactoryRequestResponse: + r""" + Creates a new `Service` with a set of attributes. + On failure `RequestResponseCreateError` will be emitted. + """ + +class ServiceDetails: + r""" + Represents all the `Service` information that one can acquire with `Service::list()`. + """ + def nodes(self) -> builtins.list[NodeState]: + r""" + A list of all `Node`s that are registered at the `Service` + """ + def attributes(self) -> AttributeSet: + r""" + Returns the attributes of the `Service` + """ + def service_id(self) -> ServiceId: + r""" + Returns the unique `ServiceId` of the `Service` + """ + def name(self) -> ServiceName: + r""" + Returns the `ServiceName` + """ + def messaging_pattern(self) -> MessagingPattern: + r""" + Returns the `Service`s underlying `MessagingPattern`. + """ + +class ServiceId: + r""" + The unique id of a `Service` + """ + @property + def as_str(self) -> builtins.str: + r""" + Returns a String containing the `ServiceId` value + """ + @staticmethod + def max_number_of_characters() -> builtins.int: + r""" + Returns the maximum string length of a `ServiceId` + """ + +class ServiceName: + r""" + Relocatable (inter-process shared memory compatible) `SemanticString` implementation for + `ServiceName`. All modification operations ensure that never an + invalid file or path name can be generated. All strings have a fixed size so that the maximum + path or file name length the system supports can be stored. + """ + @staticmethod + def new(name:builtins.str) -> ServiceName: + r""" + Creates a new `ServiceName` when the provided `name` contains a valid path to a file, + otherwise it emits a `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + Returns the maximum length of a `ServiceName` + """ + def to_string(self) -> builtins.str: + r""" + Converts the `ServiceName` into a `String` + """ + +class StaticConfigEvent: + r""" + The static configuration of an `MessagingPattern::Event` + based service. Contains all parameters that do not change during the lifetime of a + `Service`. + """ + @property + def deadline(self) -> typing.Optional[Duration]: + r""" + Returns the deadline of the service. If no new notification is signaled from any + `Notifier` after the given deadline, it is rated as an error and all `Listener`s that are + attached to a `WaitSet` are woken up and notified about the missed + """ + @property + def max_nodes(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Node`s that can open the `Service` in parallel. + """ + @property + def max_notifiers(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Notifier` ports + """ + @property + def max_listeners(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Listener` ports + """ + @property + def event_id_max_value(self) -> builtins.int: + r""" + Returns the largest `EventId` that is supported by the service + """ + @property + def notifier_created_event(self) -> typing.Optional[EventId]: + r""" + Returns the emitted `EventId` when a new notifier is created. + """ + @property + def notifier_dropped_event(self) -> typing.Optional[EventId]: + r""" + Returns the emitted `EventId` when a notifier is dropped. + """ + @property + def notifier_dead_event(self) -> typing.Optional[EventId]: + r""" + Returns the emitted `EventId` when a notifier is identified as dead. + """ + +class StaticConfigPublishSubscribe: + r""" + The static configuration of an `MessagingPattern::PublishSubscribe` based `Service`. Contains + all parameters that do not change during the lifetime of a `Service`. + """ + @property + def max_nodes(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Node`s that can open the `Service` in parallel. + """ + @property + def max_publishers(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Publisher` ports + """ + @property + def max_subscribers(self) -> builtins.int: + r""" + Returns the maximum supported amount of `Subscriber` ports + """ + @property + def history_size(self) -> builtins.int: + r""" + Returns the maximum history size that can be requested on connect. + """ + @property + def subscriber_max_buffer_size(self) -> builtins.int: + r""" + Returns the maximum supported buffer size for `Subscriber` port + """ + @property + def subscriber_max_borrowed_samples(self) -> builtins.int: + r""" + Returns how many `Sample` a `Subscriber` port can borrow in parallel at most. + """ + @property + def has_safe_overflow(self) -> builtins.bool: + r""" + Returns true if the `Service` safely overflows, otherwise false. Safe + overflow means that the `Publisher` will recycle the oldest + `Sample` from the `Subscriber` when its buffer + is full. + """ + @property + def message_type_details(self) -> MessageTypeDetails: + r""" + Returns the type details of the `Service`. + """ + +class StaticConfigRequestResponse: + r""" + The static configuration of an `MessagingPattern::RequestResponse` based service. Contains all + parameters that do not change during the lifetime of a `Service`. + """ + @property + def request_message_type_details(self) -> MessageTypeDetails: + r""" + Returns the request type details of the `Service`. + """ + @property + def response_message_type_details(self) -> MessageTypeDetails: + r""" + Returns the response type details of the `Service`. + """ + @property + def has_safe_overflow_for_requests(self) -> builtins.bool: + r""" + Returns true if the request buffer of the `Service` safely overflows, otherwise false. + Safe overflow means that the `Client` will recycle the oldest requests from the + `Server` when its buffer is full. + """ + @property + def has_safe_overflow_for_responses(self) -> builtins.bool: + r""" + Returns true if the response buffer of the `Service` safely overflows, otherwise false. + Safe overflow means that the `Server` will recycle the oldest responses from the + `Client` when its buffer is full. + """ + @property + def does_support_fire_and_forget_requests(self) -> builtins.bool: + r""" + Returns true if fire and forget `RequestMut`s can be sent from the `Client`, otherwise + false. + """ + @property + def max_borrowed_responses_per_pending_response(self) -> builtins.int: + r""" + Returns the maximum number of borrowed `Response`s a `Client` can hold in parallel per + `PendingResponse` + """ + @property + def max_active_requests_per_client(self) -> builtins.int: + r""" + Returns the maximum of active requests a `Server` can hold in parallel per `Client`. + """ + @property + def max_response_buffer_size(self) -> builtins.int: + r""" + Returns the maximum buffer size for responses for a `PendingResponse`. + """ + @property + def max_loaned_requests(self) -> builtins.int: + r""" + Returns the maximum number of `RequestMut` a `Client` can loan in parallel. + """ + @property + def max_servers(self) -> builtins.int: + r""" + Returns the maximum number of supported `Server` ports for the `Service`. + """ + @property + def max_clients(self) -> builtins.int: + r""" + Returns the maximum number of supported `Client` ports for the `Service`. + """ + @property + def max_nodes(self) -> builtins.int: + r""" + Returns the maximum number of supported `Node`s for the `Service`. + """ + +class Subscriber: + r""" + Represents the receiving endpoint of an event based communication. + """ + @property + def id(self) -> UniqueSubscriberId: + r""" + Returns the `UniqueSubscriberId` of the `Subscriber` + """ + @property + def buffer_size(self) -> builtins.int: + r""" + Returns the internal buffer size of the `Subscriber`. + """ + def has_samples(self) -> builtins.bool: + r""" + Returns true if the `Subscriber` has samples in the buffer that can be received with + `Subscriber::receive`. Emits `ConnectionFailure` on error. + """ + def receive(self) -> typing.Optional[Sample]: + r""" + Receives a `Sample` from `Publisher`. If no sample could be received `None` is returned. + If a failure occurs `ReceiveError` is returned. + """ + def delete(self) -> None: + r""" + Releases the `Subscriber`. + + After this call the `Subscriber` is no longer usable! + """ + +class TypeDetail: + r""" + Contains all type details required to connect to a `Service` + """ + @staticmethod + def new() -> TypeDetail: + r""" + Creates a new `TypeDetail` for the unit type. Meaning size == 0, alignment == 1 + """ + def type_variant(self, value:TypeVariant) -> TypeDetail: + r""" + Defines the `TypeVariant` of the defined type. `TypeVariant::FixedSize` if the type has + always the same size like an `uint64_t` or `TypeVariant::Dynamic` when it is a dynamic + array or vector + """ + def type_name(self, name:TypeName) -> TypeDetail: + r""" + Sets the unique `TypeName` of the type + """ + def size(self, size:builtins.int) -> TypeDetail: + r""" + Sets the size of the type + """ + def alignment(self, alignment:builtins.int) -> TypeDetail: + r""" + Sets the alignment of the type + """ + +class TypeName: + r""" + Represents the string name of a type. The name shall uniquely identify the type in the + communication system. + """ + @staticmethod + def new(name:builtins.str) -> TypeName: + r""" + Creates a new `TypeName`. If the provided `name` exceeds the maximum supported length + it emits an `SemanticStringError`. + """ + @staticmethod + def max_len() -> builtins.int: + r""" + The maximum supported length of a `TypeName` + """ + def to_string(self) -> builtins.str: + r""" + Returns the underlying `String` of the `TypeName` + """ + +class TypeStorage: + ... + +class UniqueClientId: + r""" + The system-wide unique id of a `Client`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class UniqueListenerId: + r""" + The system-wide unique id of a `Listener`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class UniqueNotifierId: + r""" + The system-wide unique id of a `Notifier`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class UniquePublisherId: + r""" + The system-wide unique id of a `Publisher`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class UniqueServerId: + r""" + The system-wide unique id of a `Server`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class UniqueSubscriberId: + r""" + The system-wide unique id of a `Subscriber`. + """ + @property + def value(self) -> builtins.int: + r""" + Returns the underlying raw value of the ID + """ + +class WaitSet: + r""" + The `WaitSet` implements a reactor pattern and allows to wait on multiple events in one + single call `WaitSet::wait_and_process()` until a interrupt or termination signal was received. + + The `Listener` can be attached as well as sockets or anything else that is a `FileDescriptor`. + + Can be created via the `WaitSetBuilder`. + """ + @property + def capacity(self) -> builtins.int: + r""" + Returns the capacity of the `WaitSet` + """ + @property + def len(self) -> builtins.int: + r""" + Returns the number of attachments. + """ + @property + def is_empty(self) -> builtins.bool: + r""" + Returns true if the `WaitSet` has no attachments, otherwise false. + """ + @property + def signal_handling_mode(self) -> SignalHandlingMode: + r""" + Returns the `SignalHandlingMode` with which the `WaitSet` was created. + """ + def attach_notification(self, attachment:Listener) -> WaitSetGuard: + r""" + Attaches a `Listener` as notification to the `WaitSet`. Whenever an event is received on the + object the `WaitSet` informs the user in `WaitSet::wait_and_process()` to handle the event. + The object cannot be attached twice and the + `WaitSet::capacity()` is limited by the underlying implementation. + """ + def attach_notification_fd(self, attachment:FileDescriptor) -> WaitSetGuard: + r""" + Attaches a `FileDescriptor` as notification to the `WaitSet`. Whenever an event is received on the + object the `WaitSet` informs the user in `WaitSet::wait_and_process()` to handle the event. + The object cannot be attached twice and the + `WaitSet::capacity()` is limited by the underlying implementation. + """ + def attach_deadline(self, attachment:Listener, deadline:Duration) -> WaitSetGuard: + r""" + Attaches a `Listener` as deadline to the `WaitSet`. Whenever the event is received or the + deadline is hit, the user is informed in `WaitSet::wait_and_process()`. + The object cannot be attached twice and the + `WaitSet::capacity()` is limited by the underlying implementation. + Whenever the object emits an event the deadline is reset by the `WaitSet`. + """ + def attach_deadline_fd(self, attachment:FileDescriptor, deadline:Duration) -> WaitSetGuard: + r""" + Attaches a `FileDescriptor` as deadline to the `WaitSet`. Whenever the event is received or + the deadline is hit, the user is informed in `WaitSet::wait_and_process()`. + The object cannot be attached twice and the + `WaitSet::capacity()` is limited by the underlying implementation. + Whenever the object emits an event the deadline is reset by the `WaitSet`. + """ + def attach_interval(self, interval:Duration) -> WaitSetGuard: + r""" + Attaches a tick event to the `WaitSet`. Whenever the timeout is reached the `WaitSet` + informs the user in `WaitSet::wait_and_process()`. + """ + def wait_and_process(self) -> tuple[builtins.list[WaitSetAttachmentId], WaitSetRunResult]: + r""" + Waits until an event arrives on the `WaitSet`, then collects the events corresponding + `WaitSetAttachmentId` in a vector and returns it. + + If an interrupt- (`SIGINT`) or a termination-signal (`SIGTERM`) was received, it will exit + the loop and inform the user with [`WaitSetRunResult::Interrupt`] or + [`WaitSetRunResult::TerminationRequest`]. + """ + def wait_and_process_with_timeout(self, timeout:Duration) -> tuple[builtins.list[WaitSetAttachmentId], WaitSetRunResult]: + r""" + Waits until an event arrives on the `WaitSet` or the provided timeout has passed, then + collects the events corresponding `WaitSetAttachmentId` in a vector and returns it. + + If an interrupt- (`SIGINT`) or a termination-signal (`SIGTERM`) was received, it will exit + the loop and inform the user with [`WaitSetRunResult::Interrupt`] or + [`WaitSetRunResult::TerminationRequest`]. + """ + +class WaitSetAttachmentId: + r""" + Represents an attachment to the `WaitSet` + """ + @staticmethod + def from_guard(guard:WaitSetGuard) -> WaitSetAttachmentId: + r""" + Creates an `WaitSetAttachmentId` from a `WaitSetGuard` that was returned via + `WaitSet::attach_interval()`, `WaitSet::attach_notification()` or + `WaitSet::attach_deadline()`. + """ + def has_event_from(self, other:WaitSetGuard) -> builtins.bool: + r""" + Returns true if an event was emitted from a notification or deadline attachment + corresponding to `WaitSetGuard`. + """ + def has_missed_deadline(self, other:WaitSetGuard) -> builtins.bool: + r""" + Returns true if the deadline for the attachment corresponding to `WaitSetGuard` was missed. + """ + +class WaitSetBuilder: + r""" + Creates a new `WaitSet`. + """ + @staticmethod + def new() -> WaitSetBuilder: + r""" + Instantiates a new `WaitSetBuilder` + """ + def signal_handling_mode(self, value:SignalHandlingMode) -> WaitSetBuilder: + r""" + Defines the `SignalHandlingMode` for the `WaitSet`. It affects the + `WaitSet::wait_and_process()` and `WaitSet::wait_and_process_once()` calls + that returns any received `Signal` via its `WaitSetRunResult` return value. + """ + def create(self, service_type:ServiceType) -> WaitSet: + r""" + Creates the `WaitSet`. + """ + +class WaitSetGuard: + r""" + Is returned when something is attached to the `WaitSet`. As soon as it goes out + of scope, the attachment is detached. + """ + def delete(self) -> None: + r""" + Drops the `WaitSetGuard`. After this call the `WaitSetGuard` is no longer usable. + """ + +class AllocationStrategy(Enum): + r""" + Describes generically an `AllocationStrategy`, meaning how the memory is increased when the + available memory is insufficient. + """ + BestFit = ... + r""" + Increases the memory so that it perfectly fits the new size requirements. This may lead + to a lot of reallocations but has the benefit that no byte is wasted. + """ + PowerOfTwo = ... + r""" + Increases the memory by rounding the increased memory size up to the next power of two. + Reduces reallocations a lot at the cost of increased memory usage. + """ + Static = ... + r""" + The memory is not increased. This may lead to an out-of-memory error when allocating. + """ + + def __str__(self) -> builtins.str: ... + +class LogLevel(Enum): + r""" + Describes the log level. + """ + Trace = ... + Debug = ... + Info = ... + Warn = ... + Error = ... + Fatal = ... + + def __str__(self) -> builtins.str: ... + +class MessagingPattern(Enum): + PublishSubscribe = ... + Event = ... + RequestResponse = ... + Blackboard = ... + + def __str__(self) -> builtins.str: ... + +class ServiceType(Enum): + r""" + Defines the type of the `Service` and what kind of resources and operating system mechanisms + it shall use. + """ + Local = ... + r""" + Optimized for inter-thread communication does not not support inter-process communication. + """ + Ipc = ... + r""" + Optimized for inter-process communication. + """ + + def __str__(self) -> builtins.str: ... + +class SignalHandlingMode(Enum): + r""" + Defines how signals are handled by constructs that might register a custom + `SignalHandler` + """ + HandleTerminationRequests = ... + r""" + The signals `Signal::Interrupt` and `Signal::Terminate` are registered and + handled. If such a `Signal` is received the user will be notified. + """ + Disabled = ... + r""" + No signal handler will be registered. + """ + + def __str__(self) -> builtins.str: ... + +class TypeVariant(Enum): + r""" + Defines if the type is a slice with a runtime-size (`TypeVariant::Dynamic`) + or if its a type that satisfies `Sized` (`TypeVariant::FixedSize`). + """ + FixedSize = ... + r""" + A fixed size type like `uint64_t` + """ + Dynamic = ... + r""" + A dynamic sized type like a slice (dynamic array) + """ + +class UnableToDeliverStrategy(Enum): + r""" + Defines the strategy a sender shall pursue when the buffer of the receiver is full + and the service does not overflow. + """ + Block = ... + r""" + Blocks until the receiver has consumed the + data from the buffer and there is space again + """ + DiscardSample = ... + r""" + Do not deliver the data. + """ + + def __str__(self) -> builtins.str: ... + +class WaitSetRunResult(Enum): + r""" + States why the `WaitSet::wait_and_process()` method returned. + """ + TerminationRequest = ... + r""" + A termination signal `SIGTERM` was received. + """ + Interrupt = ... + r""" + An interrupt signal `SIGINT` was received. + """ + StopRequest = ... + r""" + The users callback returned `CallbackProgression::Stop`. + """ + AllEventsHandled = ... + r""" + All events were handled. + """ + + def __str__(self) -> builtins.str: ... + +def default() -> Config: ... + +def default_config_file_name() -> FileName: + r""" + The name of the default iceoryx2 config file + """ + +def default_config_file_path() -> FilePath: + r""" + Path to the default config file + """ + +def default_user_config_file_path() -> FilePath: + r""" + Path to the default user config file + """ + +def from_file(config_file:FilePath) -> Config: + r""" + Loads a configuration from a file. On success it returns a `Config` object otherwise a + `ConfigCreationError` describing the failure. + """ + +def global_config() -> Config: ... + +def relative_config_path() -> Path: + r""" + Relative path to the config file + """ + +def set_log_level(value:LogLevel) -> None: + r""" + Sets the current log level. This is ignored for external frameworks like `log` or `tracing`. + Here you have to use the log-level settings of that framework. + """ + +def set_log_level_from_env_or(value:LogLevel) -> None: + r""" + Sets the log level by reading environment variable "IOX2_LOG_LEVEL", and if the environment variable + doesn't exit it sets it with a user-defined logging level + """ + +def set_log_level_from_env_or_default() -> None: + r""" + Sets the log level by reading environment variable "IOX2_LOG_LEVEL" or default it with LogLevel::INFO + """ + +def setup_global_config_from_file(config_file:FilePath) -> Config: ... + diff --git a/iceoryx2-ffi/python/python-src/iceoryx2/py.typed b/iceoryx2-ffi/python/python-src/iceoryx2/py.typed new file mode 100644 index 0000000000..e69de29bb2 diff --git a/iceoryx2-ffi/python/src/active_request.rs b/iceoryx2-ffi/python/src/active_request.rs index ad5d3ae58a..4e040eb486 100644 --- a/iceoryx2-ffi/python/src/active_request.rs +++ b/iceoryx2-ffi/python/src/active_request.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::LoanError, @@ -43,6 +44,7 @@ pub(crate) enum ActiveRequestType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// The `ActiveRequest` represents the object that contains the payload that the `Client` sends to the /// `Server`. @@ -54,6 +56,7 @@ pub struct ActiveRequest { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl ActiveRequest { #[getter] diff --git a/iceoryx2-ffi/python/src/alignment.rs b/iceoryx2-ffi/python/src/alignment.rs index afc434e7c4..b97ed75289 100644 --- a/iceoryx2-ffi/python/src/alignment.rs +++ b/iceoryx2-ffi/python/src/alignment.rs @@ -11,14 +11,17 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::error::InvalidAlignmentValue; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Contains the alignment memory can have. pub struct Alignment(pub(crate) iceoryx2::prelude::Alignment); +#[gen_stub_pymethods] #[pymethods] impl Alignment { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/allocation_strategy.rs b/iceoryx2-ffi/python/src/allocation_strategy.rs index a153a85365..2ba6bd15b6 100644 --- a/iceoryx2-ffi/python/src/allocation_strategy.rs +++ b/iceoryx2-ffi/python/src/allocation_strategy.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// Describes generically an `AllocationStrategy`, meaning how the memory is increased when the @@ -27,6 +29,7 @@ pub enum AllocationStrategy { Static, } +#[gen_stub_pymethods] #[pymethods] impl AllocationStrategy { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/attribute.rs b/iceoryx2-ffi/python/src/attribute.rs index 6dd049d2a1..04339fdab6 100644 --- a/iceoryx2-ffi/python/src/attribute.rs +++ b/iceoryx2-ffi/python/src/attribute.rs @@ -12,13 +12,16 @@ use crate::{attribute_key::AttributeKey, attribute_value::AttributeValue}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Represents a single service attribute (key-value) pair that can be defined when the service /// is being created. pub struct Attribute(pub(crate) iceoryx2::service::attribute::Attribute); +#[gen_stub_pymethods] #[pymethods] impl Attribute { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/attribute_key.rs b/iceoryx2-ffi/python/src/attribute_key.rs index 3101a84f51..115fe80919 100644 --- a/iceoryx2-ffi/python/src/attribute_key.rs +++ b/iceoryx2-ffi/python/src/attribute_key.rs @@ -13,13 +13,16 @@ use crate::error::SemanticStringError; use iceoryx2::prelude::SemanticString; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) `SemanticString` implementation for /// `AttributeKey`. pub struct AttributeKey(pub(crate) iceoryx2::service::attribute::AttributeKey); +#[gen_stub_pymethods] #[pymethods] impl AttributeKey { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/attribute_set.rs b/iceoryx2-ffi/python/src/attribute_set.rs index 123e195fc0..44e962ad49 100644 --- a/iceoryx2-ffi/python/src/attribute_set.rs +++ b/iceoryx2-ffi/python/src/attribute_set.rs @@ -11,15 +11,18 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{attribute::Attribute, attribute_key::AttributeKey, attribute_value::AttributeValue}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Represents a single service attribute (key-value) pair that can be defined when the service /// is being created. pub struct AttributeSet(pub(crate) iceoryx2::service::attribute::AttributeSet); +#[gen_stub_pymethods] #[pymethods] impl AttributeSet { #[getter] diff --git a/iceoryx2-ffi/python/src/attribute_specifier.rs b/iceoryx2-ffi/python/src/attribute_specifier.rs index 442fb9c901..b620759921 100644 --- a/iceoryx2-ffi/python/src/attribute_specifier.rs +++ b/iceoryx2-ffi/python/src/attribute_specifier.rs @@ -11,11 +11,13 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ attribute_key::AttributeKey, attribute_set::AttributeSet, attribute_value::AttributeValue, }; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Represents a single service attribute (key-value) pair that can be defined when the service /// is being created. @@ -27,6 +29,7 @@ impl Default for AttributeSpecifier { } } +#[gen_stub_pymethods] #[pymethods] impl AttributeSpecifier { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/attribute_value.rs b/iceoryx2-ffi/python/src/attribute_value.rs index b84ecbe4d1..4ed175041a 100644 --- a/iceoryx2-ffi/python/src/attribute_value.rs +++ b/iceoryx2-ffi/python/src/attribute_value.rs @@ -13,13 +13,16 @@ use crate::error::SemanticStringError; use iceoryx2::prelude::SemanticString; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) `SemanticString` implementation for /// `AttributeValue`. pub struct AttributeValue(pub(crate) iceoryx2::service::attribute::AttributeValue); +#[gen_stub_pymethods] #[pymethods] impl AttributeValue { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/attribute_verifier.rs b/iceoryx2-ffi/python/src/attribute_verifier.rs index 72a849db14..dfbfb74294 100644 --- a/iceoryx2-ffi/python/src/attribute_verifier.rs +++ b/iceoryx2-ffi/python/src/attribute_verifier.rs @@ -11,12 +11,14 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ attribute_key::AttributeKey, attribute_set::AttributeSet, attribute_value::AttributeValue, }; use iceoryx2::prelude::SemanticString; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Represents a single service attribute (key-value) pair that can be defined when the service /// is being created. @@ -28,6 +30,7 @@ impl Default for AttributeVerifier { } } +#[gen_stub_pymethods] #[pymethods] impl AttributeVerifier { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/cleanup_state.rs b/iceoryx2-ffi/python/src/cleanup_state.rs index c14fdd99be..c023ee425c 100644 --- a/iceoryx2-ffi/python/src/cleanup_state.rs +++ b/iceoryx2-ffi/python/src/cleanup_state.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Returned by `Node.cleanup_dead_nodes()`. Contains the cleanup report of the call /// and contains the number of dead nodes that were successfully cleaned up and how many @@ -20,6 +22,7 @@ use pyo3::prelude::*; /// have the permission to access the corresponding resources. pub struct CleanupState(pub(crate) iceoryx2::node::CleanupState); +#[gen_stub_pymethods] #[pymethods] impl CleanupState { #[getter] diff --git a/iceoryx2-ffi/python/src/client.rs b/iceoryx2-ffi/python/src/client.rs index 7866d05432..7f2ddf6872 100644 --- a/iceoryx2-ffi/python/src/client.rs +++ b/iceoryx2-ffi/python/src/client.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::LoanError, @@ -43,6 +44,7 @@ pub(crate) enum ClientType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// Represents the receiving endpoint of an event based communication. pub struct Client { @@ -53,6 +55,7 @@ pub struct Client { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Client { #[getter] diff --git a/iceoryx2-ffi/python/src/config.rs b/iceoryx2-ffi/python/src/config.rs index 360473dd3a..9c15d98e8c 100644 --- a/iceoryx2-ffi/python/src/config.rs +++ b/iceoryx2-ffi/python/src/config.rs @@ -18,11 +18,14 @@ use crate::parc::Parc; use crate::path::Path; use crate::unable_to_deliver_strategy::UnableToDeliverStrategy; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pyfunction, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass] /// All configurable settings of a `Node`. pub struct Node(Parc); +#[gen_stub_pymethods] #[pymethods] impl Node { pub fn __str__(&self) -> String { @@ -106,10 +109,12 @@ impl Node { } } +#[gen_stub_pyclass] #[pyclass] /// All configurable settings of a `Service`. pub struct Service(Parc); +#[gen_stub_pymethods] #[pymethods] impl Service { pub fn __str__(&self) -> String { @@ -216,11 +221,13 @@ impl Service { } } +#[gen_stub_pyclass] #[pyclass] /// Default settings for the publish-subscribe messaging pattern. These settings are used unless /// the user specifies custom QoS or port settings. pub struct PublishSubscribe(Parc); +#[gen_stub_pymethods] #[pymethods] impl PublishSubscribe { pub fn __str__(&self) -> String { @@ -413,11 +420,13 @@ impl PublishSubscribe { } } +#[gen_stub_pyclass] #[pyclass] /// Default settings for the event messaging pattern. These settings are used unless /// the user specifies custom QoS or port settings. pub struct Event(Parc); +#[gen_stub_pymethods] #[pymethods] impl Event { pub fn __str__(&self) -> String { @@ -594,11 +603,13 @@ impl Event { } } +#[gen_stub_pyclass] #[pyclass] /// Default settings for the request response messaging pattern. These settings are used unless /// the user specifies custom QoS or port settings. pub struct RequestResponse(Parc); +#[gen_stub_pymethods] #[pymethods] impl RequestResponse { pub fn __str__(&self) -> String { @@ -913,10 +924,12 @@ impl RequestResponse { } } +#[gen_stub_pyclass] #[pyclass] /// The global settings pub struct Global(Parc); +#[gen_stub_pymethods] #[pymethods] impl Global { pub fn __str__(&self) -> String { @@ -972,11 +985,13 @@ impl Global { } } +#[gen_stub_pyclass] #[pyclass] /// Default settings. These values are used when the user in the code does not specify anything /// else. pub struct Defaults(Parc); +#[gen_stub_pymethods] #[pymethods] impl Defaults { pub fn __str__(&self) -> String { @@ -1002,6 +1017,7 @@ impl Defaults { } } +#[gen_stub_pyclass] #[pyclass] /// Represents the configuration that iceoryx2 will utilize. It is divided into two sections: /// the [Global] settings, which must align with the iceoryx2 instance the application intends to @@ -1015,6 +1031,7 @@ impl PartialEq for Config { } } +#[gen_stub_pymethods] #[pymethods] impl Config { pub fn __eq__(&self, other: &Self) -> bool { @@ -1038,16 +1055,19 @@ impl Config { } } +#[gen_stub_pyfunction] #[pyfunction] pub fn default() -> Config { Config(Parc::new(iceoryx2::config::Config::default())) } +#[gen_stub_pyfunction] #[pyfunction] pub fn global_config() -> Config { Config(Parc::new(iceoryx2::config::Config::global_config().clone())) } +#[gen_stub_pyfunction] #[pyfunction] pub fn setup_global_config_from_file(config_file: &FilePath) -> PyResult { Ok(Config(Parc::new( @@ -1057,6 +1077,7 @@ pub fn setup_global_config_from_file(config_file: &FilePath) -> PyResult ))) } +#[gen_stub_pyfunction] #[pyfunction] /// Loads a configuration from a file. On success it returns a `Config` object otherwise a /// `ConfigCreationError` describing the failure. @@ -1068,24 +1089,28 @@ pub fn from_file(config_file: &FilePath) -> PyResult { ))) } +#[gen_stub_pyfunction] #[pyfunction] /// Path to the default user config file pub fn default_user_config_file_path() -> FilePath { FilePath(iceoryx2::config::Config::default_user_config_file_path()) } +#[gen_stub_pyfunction] #[pyfunction] /// Relative path to the config file pub fn relative_config_path() -> Path { Path(iceoryx2::config::Config::relative_config_path()) } +#[gen_stub_pyfunction] #[pyfunction] /// Path to the default config file pub fn default_config_file_path() -> FilePath { FilePath(iceoryx2::config::Config::default_config_file_path()) } +#[gen_stub_pyfunction] #[pyfunction] /// The name of the default iceoryx2 config file pub fn default_config_file_name() -> FileName { diff --git a/iceoryx2-ffi/python/src/duration.rs b/iceoryx2-ffi/python/src/duration.rs index 8c69cf3dfc..9a7d379f58 100644 --- a/iceoryx2-ffi/python/src/duration.rs +++ b/iceoryx2-ffi/python/src/duration.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Represents a time duration. pub struct Duration(pub(crate) core::time::Duration); +#[gen_stub_pymethods] #[pymethods] impl Duration { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/event_id.rs b/iceoryx2-ffi/python/src/event_id.rs index e771939c0d..8fdb7a9a34 100644 --- a/iceoryx2-ffi/python/src/event_id.rs +++ b/iceoryx2-ffi/python/src/event_id.rs @@ -11,13 +11,16 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq)] /// User defined identifier that can be provided in `Notifier.notify()` to signal a specific /// kind of event. pub struct EventId(pub(crate) iceoryx2::prelude::EventId); +#[gen_stub_pymethods] #[pymethods] impl EventId { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/file_descriptor.rs b/iceoryx2-ffi/python/src/file_descriptor.rs index 20ded5a1cb..5f5643e5cf 100644 --- a/iceoryx2-ffi/python/src/file_descriptor.rs +++ b/iceoryx2-ffi/python/src/file_descriptor.rs @@ -13,9 +13,11 @@ use std::sync::Arc; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; -#[derive(Debug)] +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] +#[derive(Debug)] /// Represents a FileDescriptor in a POSIX system. Contains always a value greater or equal zero, /// a valid file descriptor. It takes the ownership of the provided file descriptor and calls /// `posix::close` on destruction. @@ -29,6 +31,7 @@ impl iceoryx2::prelude::FileDescriptorBased for FileDescriptor { impl iceoryx2::prelude::SynchronousMultiplexing for FileDescriptor {} +#[gen_stub_pymethods] #[pymethods] impl FileDescriptor { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/file_name.rs b/iceoryx2-ffi/python/src/file_name.rs index 292a08d089..1f79df85d5 100644 --- a/iceoryx2-ffi/python/src/file_name.rs +++ b/iceoryx2-ffi/python/src/file_name.rs @@ -13,7 +13,9 @@ use crate::error::SemanticStringError; use iceoryx2::prelude::SemanticString; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) `SemanticString` implementation for @@ -22,6 +24,7 @@ use pyo3::prelude::*; /// path or file name length the system supports can be stored. pub struct FileName(pub(crate) iceoryx2::prelude::FileName); +#[gen_stub_pymethods] #[pymethods] impl FileName { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/file_path.rs b/iceoryx2-ffi/python/src/file_path.rs index 2c9ffbba7c..d3301039a1 100644 --- a/iceoryx2-ffi/python/src/file_path.rs +++ b/iceoryx2-ffi/python/src/file_path.rs @@ -13,7 +13,9 @@ use crate::error::SemanticStringError; use iceoryx2::prelude::SemanticString; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) `SemanticString` implementation for @@ -22,6 +24,7 @@ use pyo3::prelude::*; /// path or file name length the system supports can be stored. pub struct FilePath(pub(crate) iceoryx2::prelude::FilePath); +#[gen_stub_pymethods] #[pymethods] impl FilePath { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/header_publish_subscribe.rs b/iceoryx2-ffi/python/src/header_publish_subscribe.rs index 53d606c0d6..083688f566 100644 --- a/iceoryx2-ffi/python/src/header_publish_subscribe.rs +++ b/iceoryx2-ffi/python/src/header_publish_subscribe.rs @@ -11,14 +11,17 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{node_id::NodeId, unique_publisher_id::UniquePublisherId}; +#[gen_stub_pyclass] #[pyclass(eq)] #[derive(PartialEq, Eq)] /// Sample header used by `MessagingPattern::PublishSubscribe` pub struct HeaderPublishSubscribe(pub(crate) iceoryx2::service::header::publish_subscribe::Header); +#[gen_stub_pymethods] #[pymethods] impl HeaderPublishSubscribe { #[getter] diff --git a/iceoryx2-ffi/python/src/lib.rs b/iceoryx2-ffi/python/src/lib.rs index 9bbbf4d974..f2ca1cfa52 100644 --- a/iceoryx2-ffi/python/src/lib.rs +++ b/iceoryx2-ffi/python/src/lib.rs @@ -98,10 +98,13 @@ pub mod waitset_run_result; use pyo3::prelude::*; use pyo3::wrap_pymodule; +use pyo3_stub_gen::define_stub_info_gatherer; pub(crate) use service_type::IpcService; pub(crate) use service_type::LocalService; +define_stub_info_gatherer!(stub_info); + /// iceoryx2 Python language bindings #[pymodule] fn _iceoryx2(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { diff --git a/iceoryx2-ffi/python/src/listener.rs b/iceoryx2-ffi/python/src/listener.rs index bad6bc33b2..f840f3fd7a 100644 --- a/iceoryx2-ffi/python/src/listener.rs +++ b/iceoryx2-ffi/python/src/listener.rs @@ -14,6 +14,7 @@ use std::sync::Arc; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ duration::Duration, error::ListenerWaitError, event_id::EventId, @@ -27,10 +28,12 @@ pub(crate) enum ListenerType { Local(Option>>), } +#[gen_stub_pyclass] #[pyclass] /// Represents the receiving endpoint of an event based communication. pub struct Listener(pub(crate) ListenerType); +#[gen_stub_pymethods] #[pymethods] impl Listener { #[getter] diff --git a/iceoryx2-ffi/python/src/log.rs b/iceoryx2-ffi/python/src/log.rs index 3c3901dce6..b781415105 100644 --- a/iceoryx2-ffi/python/src/log.rs +++ b/iceoryx2-ffi/python/src/log.rs @@ -11,9 +11,11 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::gen_stub_pyfunction; use crate::log_level::LogLevel; +#[gen_stub_pyfunction] #[pyfunction] /// Sets the current log level. This is ignored for external frameworks like `log` or `tracing`. /// Here you have to use the log-level settings of that framework. @@ -21,6 +23,7 @@ pub fn set_log_level(value: LogLevel) { iceoryx2::prelude::set_log_level(value.into()); } +#[gen_stub_pyfunction] #[pyfunction] /// Sets the log level by reading environment variable "IOX2_LOG_LEVEL", and if the environment variable /// doesn't exit it sets it with a user-defined logging level @@ -28,6 +31,7 @@ pub fn set_log_level_from_env_or(value: LogLevel) { iceoryx2::prelude::set_log_level_from_env_or(value.into()); } +#[gen_stub_pyfunction] #[pyfunction] /// Sets the log level by reading environment variable "IOX2_LOG_LEVEL" or default it with LogLevel::INFO pub fn set_log_level_from_env_or_default() { diff --git a/iceoryx2-ffi/python/src/log_level.rs b/iceoryx2-ffi/python/src/log_level.rs index 8e9f140aa9..13f6f3aa64 100644 --- a/iceoryx2-ffi/python/src/log_level.rs +++ b/iceoryx2-ffi/python/src/log_level.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// Describes the log level. @@ -24,6 +26,7 @@ pub enum LogLevel { Fatal = 5, } +#[gen_stub_pymethods] #[pymethods] impl LogLevel { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/message_type_details.rs b/iceoryx2-ffi/python/src/message_type_details.rs index ce16ce306e..61a968f3f1 100644 --- a/iceoryx2-ffi/python/src/message_type_details.rs +++ b/iceoryx2-ffi/python/src/message_type_details.rs @@ -11,15 +11,18 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::type_detail::TypeDetail; +#[gen_stub_pyclass] #[pyclass] /// Contains all type information to the header and payload type. pub struct MessageTypeDetails( pub(crate) iceoryx2::service::static_config::message_type_details::MessageTypeDetails, ); +#[gen_stub_pymethods] #[pymethods] impl MessageTypeDetails { #[getter] diff --git a/iceoryx2-ffi/python/src/messaging_pattern.rs b/iceoryx2-ffi/python/src/messaging_pattern.rs index 32f5f046d1..89cd9cc17d 100644 --- a/iceoryx2-ffi/python/src/messaging_pattern.rs +++ b/iceoryx2-ffi/python/src/messaging_pattern.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] pub enum MessagingPattern { @@ -21,6 +23,7 @@ pub enum MessagingPattern { Blackboard, } +#[gen_stub_pymethods] #[pymethods] impl MessagingPattern { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/node.rs b/iceoryx2-ffi/python/src/node.rs index 24c87ce036..a2a5c8802c 100644 --- a/iceoryx2-ffi/python/src/node.rs +++ b/iceoryx2-ffi/python/src/node.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ cleanup_state::CleanupState, @@ -32,6 +33,7 @@ pub(crate) enum NodeType { Local(iceoryx2::node::Node), } +#[gen_stub_pyclass] #[pyclass] /// The central entry point of iceoryx2. Represents a node of the iceoryx2 /// system. One process can have arbitrary many nodes but usually it should be @@ -39,6 +41,7 @@ pub(crate) enum NodeType { /// Can be created via the `NodeBuilder`. pub struct Node(pub(crate) Parc); +#[gen_stub_pymethods] #[pymethods] impl Node { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/node_builder.rs b/iceoryx2-ffi/python/src/node_builder.rs index 1c07f97454..225781b7ca 100644 --- a/iceoryx2-ffi/python/src/node_builder.rs +++ b/iceoryx2-ffi/python/src/node_builder.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ config::Config, @@ -23,10 +24,12 @@ use crate::{ }; #[derive(Default)] +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Creates a new `Node`. pub struct NodeBuilder(iceoryx2::prelude::NodeBuilder); +#[gen_stub_pymethods] #[pymethods] impl NodeBuilder { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/node_id.rs b/iceoryx2-ffi/python/src/node_id.rs index 7b15afea85..7573b81f01 100644 --- a/iceoryx2-ffi/python/src/node_id.rs +++ b/iceoryx2-ffi/python/src/node_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] #[derive(Clone, PartialEq)] /// The system-wide unique id of a `Node` pub struct NodeId(pub(crate) iceoryx2::node::NodeId); +#[gen_stub_pymethods] #[pymethods] impl NodeId { pub fn __eq__(&self, other: &Self) -> bool { diff --git a/iceoryx2-ffi/python/src/node_name.rs b/iceoryx2-ffi/python/src/node_name.rs index 50e7741dda..ce69ff8b7b 100644 --- a/iceoryx2-ffi/python/src/node_name.rs +++ b/iceoryx2-ffi/python/src/node_name.rs @@ -12,12 +12,15 @@ use crate::error::SemanticStringError; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Represent the name for a `Node`. pub struct NodeName(pub(crate) iceoryx2::prelude::NodeName); +#[gen_stub_pymethods] #[pymethods] impl NodeName { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/node_state.rs b/iceoryx2-ffi/python/src/node_state.rs index cdcf716bb0..50ecc0a7f2 100644 --- a/iceoryx2-ffi/python/src/node_state.rs +++ b/iceoryx2-ffi/python/src/node_state.rs @@ -12,6 +12,7 @@ use iceoryx2::node::NodeView; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pyclass_complex_enum, gen_stub_pymethods}; use crate::{ config::Config, error::NodeCleanupFailure, file_name::FileName, node_id::NodeId, @@ -30,11 +31,13 @@ pub(crate) enum DeadNodeViewType { Local(iceoryx2::node::DeadNodeView), } +#[gen_stub_pyclass] #[pyclass] #[derive(Clone)] /// Contains details of a `Node`. pub struct NodeDetails(pub(crate) iceoryx2::node::NodeDetails); +#[gen_stub_pymethods] #[pymethods] impl NodeDetails { #[getter] @@ -56,11 +59,13 @@ impl NodeDetails { } } +#[gen_stub_pyclass] #[pyclass] #[derive(Clone)] /// Contains all details of a `Node` that is alive. pub struct AliveNodeView(pub(crate) AliveNodeViewType); +#[gen_stub_pymethods] #[pymethods] impl AliveNodeView { #[getter] @@ -83,11 +88,13 @@ impl AliveNodeView { } } +#[gen_stub_pyclass] #[pyclass] #[derive(Clone)] /// Contains all details of a `Node` that is dead. pub struct DeadNodeView(pub(crate) DeadNodeViewType); +#[gen_stub_pymethods] #[pymethods] impl DeadNodeView { #[getter] @@ -127,6 +134,7 @@ impl DeadNodeView { } } +#[gen_stub_pyclass_complex_enum] #[pyclass] #[derive(Clone)] /// Describes the state of a `Node`. diff --git a/iceoryx2-ffi/python/src/notifier.rs b/iceoryx2-ffi/python/src/notifier.rs index b8debff427..252cb972c0 100644 --- a/iceoryx2-ffi/python/src/notifier.rs +++ b/iceoryx2-ffi/python/src/notifier.rs @@ -12,6 +12,7 @@ use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ duration::Duration, error::NotifierNotifyError, event_id::EventId, @@ -23,10 +24,12 @@ pub(crate) enum NotifierType { Local(Option>), } +#[gen_stub_pyclass] #[pyclass] /// Represents the sending endpoint of an event based communication. pub struct Notifier(pub(crate) NotifierType); +#[gen_stub_pymethods] #[pymethods] impl Notifier { #[getter] diff --git a/iceoryx2-ffi/python/src/path.rs b/iceoryx2-ffi/python/src/path.rs index 441f8a0be9..d3953f6466 100644 --- a/iceoryx2-ffi/python/src/path.rs +++ b/iceoryx2-ffi/python/src/path.rs @@ -13,7 +13,9 @@ use crate::error::SemanticStringError; use iceoryx2::prelude::SemanticString; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) SemanticString implementation for @@ -22,6 +24,7 @@ use pyo3::prelude::*; /// path or file name length the system supports can be stored. pub struct Path(pub(crate) iceoryx2::prelude::Path); +#[gen_stub_pymethods] #[pymethods] impl Path { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/pending_response.rs b/iceoryx2-ffi/python/src/pending_response.rs index fdcb797888..049f53f195 100644 --- a/iceoryx2-ffi/python/src/pending_response.rs +++ b/iceoryx2-ffi/python/src/pending_response.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::ReceiveError, @@ -42,6 +43,7 @@ pub(crate) enum PendingResponseType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// Represents an active connection to all `Server` that received the `RequestMut`. The /// `Client` can use it to receive the corresponding `Response`s. @@ -55,6 +57,7 @@ pub struct PendingResponse { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl PendingResponse { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_client.rs b/iceoryx2-ffi/python/src/port_factory_client.rs index 63beb15c10..afda55f671 100644 --- a/iceoryx2-ffi/python/src/port_factory_client.rs +++ b/iceoryx2-ffi/python/src/port_factory_client.rs @@ -13,6 +13,7 @@ use crate::{error::ClientCreateError, type_storage::TypeStorage}; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ allocation_strategy::AllocationStrategy, @@ -44,6 +45,7 @@ pub(crate) enum PortFactoryClientType { Local(Parc>), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Client` port/endpoint for `MessagingPattern::RequestResponse` /// based communication. @@ -110,6 +112,7 @@ impl PortFactoryClient { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryClient { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_event.rs b/iceoryx2-ffi/python/src/port_factory_event.rs index 6066e29f2d..e69db39bb9 100644 --- a/iceoryx2-ffi/python/src/port_factory_event.rs +++ b/iceoryx2-ffi/python/src/port_factory_event.rs @@ -12,6 +12,7 @@ use iceoryx2::prelude::{CallbackProgression, PortFactory}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ attribute_set::AttributeSet, @@ -31,11 +32,13 @@ pub(crate) enum PortFactoryEventType { Local(iceoryx2::service::port_factory::event::PortFactory), } +#[gen_stub_pyclass] #[pyclass] /// The factory for `MessagingPattern::Event`. It can acquire dynamic and static service /// informations and create `Notifier` or `Listener` ports. pub struct PortFactoryEvent(pub(crate) Parc); +#[gen_stub_pymethods] #[pymethods] impl PortFactoryEvent { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_listener.rs b/iceoryx2-ffi/python/src/port_factory_listener.rs index 50c3d22e63..e88b7358e9 100644 --- a/iceoryx2-ffi/python/src/port_factory_listener.rs +++ b/iceoryx2-ffi/python/src/port_factory_listener.rs @@ -13,6 +13,7 @@ use std::sync::Arc; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::ListenerCreateError, @@ -32,6 +33,7 @@ pub(crate) enum PortFactoryListenerType { ), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Listener` port/endpoint for `MessagingPattern::Event` based /// communication. @@ -71,6 +73,7 @@ impl PortFactoryListener { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryListener { /// Creates the `Listener` port or emits a `ListenerCreateError` on failure. diff --git a/iceoryx2-ffi/python/src/port_factory_notifier.rs b/iceoryx2-ffi/python/src/port_factory_notifier.rs index f0de23b30f..9c21a95ebf 100644 --- a/iceoryx2-ffi/python/src/port_factory_notifier.rs +++ b/iceoryx2-ffi/python/src/port_factory_notifier.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::NotifierCreateError, @@ -31,6 +32,7 @@ pub(crate) enum PortFactoryNotifierType { ), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Notifier` port/endpoint for `MessagingPattern::Event` based /// communication. @@ -70,6 +72,7 @@ impl PortFactoryNotifier { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryNotifier { /// Creates a new `Notifier` port or emits a `NotifierCreateError` on failure. diff --git a/iceoryx2-ffi/python/src/port_factory_publish_subscribe.rs b/iceoryx2-ffi/python/src/port_factory_publish_subscribe.rs index 4aa7c28e00..cd758555ff 100644 --- a/iceoryx2-ffi/python/src/port_factory_publish_subscribe.rs +++ b/iceoryx2-ffi/python/src/port_factory_publish_subscribe.rs @@ -13,6 +13,7 @@ use iceoryx2::prelude::{CallbackProgression, PortFactory}; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::attribute_set::AttributeSet; use crate::error::NodeListFailure; @@ -45,6 +46,7 @@ pub(crate) enum PortFactoryPublishSubscribeType { ), } +#[gen_stub_pyclass] #[pyclass] /// The factory for `MessagingPattern::PublishSubscribe`. It can acquire dynamic and static service /// informations and create `Publisher` or `Subscriber` ports. @@ -68,6 +70,7 @@ impl PortFactoryPublishSubscribe { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryPublishSubscribe { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_publisher.rs b/iceoryx2-ffi/python/src/port_factory_publisher.rs index 76682433a0..1716022371 100644 --- a/iceoryx2-ffi/python/src/port_factory_publisher.rs +++ b/iceoryx2-ffi/python/src/port_factory_publisher.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ allocation_strategy::AllocationStrategy, @@ -42,6 +43,7 @@ pub(crate) enum PortFactoryPublisherType { Local(Parc>), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Publisher` port/endpoint for `MessagingPattern::PublishSubscribe` /// based communication. @@ -100,6 +102,7 @@ impl PortFactoryPublisher { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryPublisher { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_request_response.rs b/iceoryx2-ffi/python/src/port_factory_request_response.rs index c8edadd8e5..cb939682ae 100644 --- a/iceoryx2-ffi/python/src/port_factory_request_response.rs +++ b/iceoryx2-ffi/python/src/port_factory_request_response.rs @@ -13,6 +13,7 @@ use iceoryx2::prelude::{CallbackProgression, PortFactory}; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::attribute_set::AttributeSet; use crate::error::NodeListFailure; @@ -50,6 +51,7 @@ pub(crate) enum PortFactoryRequestResponseType { ), } +#[gen_stub_pyclass] #[pyclass] /// The factory for `MessagingPattern::RequestResponse`. It can acquire dynamic and static service /// informations and create `Client` or `Server` ports. @@ -61,6 +63,7 @@ pub struct PortFactoryRequestResponse { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryRequestResponse { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_server.rs b/iceoryx2-ffi/python/src/port_factory_server.rs index 90f0d51329..253f372246 100644 --- a/iceoryx2-ffi/python/src/port_factory_server.rs +++ b/iceoryx2-ffi/python/src/port_factory_server.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ allocation_strategy::AllocationStrategy, @@ -45,6 +46,7 @@ pub(crate) enum PortFactoryServerType { Local(Parc>), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Server` port/endpoint for `MessagingPattern::RequestResponse` based /// communication. @@ -111,6 +113,7 @@ impl PortFactoryServer { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactoryServer { #[getter] diff --git a/iceoryx2-ffi/python/src/port_factory_subscriber.rs b/iceoryx2-ffi/python/src/port_factory_subscriber.rs index 24aad45f1e..f8f5919e7d 100644 --- a/iceoryx2-ffi/python/src/port_factory_subscriber.rs +++ b/iceoryx2-ffi/python/src/port_factory_subscriber.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::SubscriberCreateError, @@ -41,6 +42,7 @@ pub(crate) enum PortFactorySubscriberType { Local(Parc>), } +#[gen_stub_pyclass] #[pyclass] /// Factory to create a new `Subscriber` port/endpoint for /// `MessagingPattern::PublishSubscribe` based communication. @@ -101,6 +103,7 @@ impl PortFactorySubscriber { } } +#[gen_stub_pymethods] #[pymethods] impl PortFactorySubscriber { /// Defines the buffer size of the `Subscriber`. Smallest possible value is `1`. diff --git a/iceoryx2-ffi/python/src/publisher.rs b/iceoryx2-ffi/python/src/publisher.rs index fdeac8e5a0..3f316d0aef 100644 --- a/iceoryx2-ffi/python/src/publisher.rs +++ b/iceoryx2-ffi/python/src/publisher.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::LoanError, @@ -44,6 +45,7 @@ pub(crate) enum PublisherType { ), } +#[gen_stub_pyclass] #[pyclass] /// Represents the receiving endpoint of an event based communication. pub struct Publisher { @@ -52,6 +54,7 @@ pub struct Publisher { pub(crate) user_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Publisher { #[getter] diff --git a/iceoryx2-ffi/python/src/request_header.rs b/iceoryx2-ffi/python/src/request_header.rs index f89ccf1345..aed9666ed7 100644 --- a/iceoryx2-ffi/python/src/request_header.rs +++ b/iceoryx2-ffi/python/src/request_header.rs @@ -11,13 +11,16 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::unique_client_id::UniqueClientId; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Request header used by `MessagingPattern::RequestResponse` pub struct RequestHeader(pub(crate) iceoryx2::service::header::request_response::RequestHeader); +#[gen_stub_pymethods] #[pymethods] impl RequestHeader { #[getter] diff --git a/iceoryx2-ffi/python/src/request_mut.rs b/iceoryx2-ffi/python/src/request_mut.rs index 2545ddb784..d224715488 100644 --- a/iceoryx2-ffi/python/src/request_mut.rs +++ b/iceoryx2-ffi/python/src/request_mut.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::RequestSendError, @@ -42,6 +43,7 @@ pub(crate) enum RequestMutType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// The `RequestMut` represents the object that contains the payload that the `Client` sends to the /// `Server`. @@ -53,6 +55,7 @@ pub struct RequestMut { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl RequestMut { #[getter] diff --git a/iceoryx2-ffi/python/src/request_mut_uninit.rs b/iceoryx2-ffi/python/src/request_mut_uninit.rs index 6f3a29e128..adb141482f 100644 --- a/iceoryx2-ffi/python/src/request_mut_uninit.rs +++ b/iceoryx2-ffi/python/src/request_mut_uninit.rs @@ -15,6 +15,7 @@ use core::mem::MaybeUninit; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ parc::Parc, @@ -43,6 +44,7 @@ pub(crate) enum RequestMutUninitType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// A version of the `RequestMut` where the payload is not initialized which allows /// true zero copy usage. To send a `RequestMutUninit` it must be first initialized @@ -55,6 +57,7 @@ pub struct RequestMutUninit { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl RequestMutUninit { #[getter] diff --git a/iceoryx2-ffi/python/src/response.rs b/iceoryx2-ffi/python/src/response.rs index d215400c24..19fe41b280 100644 --- a/iceoryx2-ffi/python/src/response.rs +++ b/iceoryx2-ffi/python/src/response.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ parc::Parc, response_header::ResponseHeader, type_storage::TypeStorage, @@ -29,6 +30,7 @@ pub(crate) enum ResponseType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// It stores the payload and can be received by the `PendingResponse` after a `RequestMut` was /// sent to a `Server` via the `Client`. @@ -38,6 +40,7 @@ pub struct Response { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Response { #[getter] diff --git a/iceoryx2-ffi/python/src/response_header.rs b/iceoryx2-ffi/python/src/response_header.rs index e08209ef75..e02a639378 100644 --- a/iceoryx2-ffi/python/src/response_header.rs +++ b/iceoryx2-ffi/python/src/response_header.rs @@ -11,13 +11,16 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::unique_server_id::UniqueServerId; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Response header used by `MessagingPattern::RequestResponse` pub struct ResponseHeader(pub(crate) iceoryx2::service::header::request_response::ResponseHeader); +#[gen_stub_pymethods] #[pymethods] impl ResponseHeader { #[getter] diff --git a/iceoryx2-ffi/python/src/response_mut.rs b/iceoryx2-ffi/python/src/response_mut.rs index cc68dce428..49a159e53b 100644 --- a/iceoryx2-ffi/python/src/response_mut.rs +++ b/iceoryx2-ffi/python/src/response_mut.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::SendError, parc::Parc, response_header::ResponseHeader, type_storage::TypeStorage, @@ -34,6 +35,7 @@ pub(crate) enum ResponseMutType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] pub struct ResponseMut { pub(crate) value: Parc, @@ -41,6 +43,7 @@ pub struct ResponseMut { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl ResponseMut { #[getter] diff --git a/iceoryx2-ffi/python/src/response_mut_uninit.rs b/iceoryx2-ffi/python/src/response_mut_uninit.rs index d22871dd3b..b544a188b0 100644 --- a/iceoryx2-ffi/python/src/response_mut_uninit.rs +++ b/iceoryx2-ffi/python/src/response_mut_uninit.rs @@ -15,6 +15,7 @@ use core::mem::MaybeUninit; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ parc::Parc, @@ -39,6 +40,7 @@ pub(crate) enum ResponseMutUninitType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// Acquired by a `ActiveRequest` with /// * `ActiveRequest::loan_uninit()` @@ -54,6 +56,7 @@ pub struct ResponseMutUninit { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl ResponseMutUninit { #[getter] diff --git a/iceoryx2-ffi/python/src/sample.rs b/iceoryx2-ffi/python/src/sample.rs index fb25532cb8..f197c6eacc 100644 --- a/iceoryx2-ffi/python/src/sample.rs +++ b/iceoryx2-ffi/python/src/sample.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ header_publish_subscribe::HeaderPublishSubscribe, parc::Parc, type_storage::TypeStorage, @@ -35,6 +36,7 @@ pub(crate) enum SampleType { ), } +#[gen_stub_pyclass] #[pyclass] /// It stores the payload and is acquired by the `Subscriber` whenever /// it receives new data from a `Publisher` via `Subscriber::receive()`. @@ -44,6 +46,7 @@ pub struct Sample { pub user_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Sample { #[getter] diff --git a/iceoryx2-ffi/python/src/sample_mut.rs b/iceoryx2-ffi/python/src/sample_mut.rs index b949eee6c2..3af85b7d2d 100644 --- a/iceoryx2-ffi/python/src/sample_mut.rs +++ b/iceoryx2-ffi/python/src/sample_mut.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::SendError, header_publish_subscribe::HeaderPublishSubscribe, parc::Parc, @@ -40,6 +41,7 @@ pub(crate) enum SampleMutType { ), } +#[gen_stub_pyclass] #[pyclass] /// Acquired by a `Publisher` via /// * `Publisher::loan()`, @@ -54,6 +56,7 @@ pub struct SampleMut { pub(crate) user_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl SampleMut { #[getter] diff --git a/iceoryx2-ffi/python/src/sample_mut_uninit.rs b/iceoryx2-ffi/python/src/sample_mut_uninit.rs index 8d6b17fac2..c842a89073 100644 --- a/iceoryx2-ffi/python/src/sample_mut_uninit.rs +++ b/iceoryx2-ffi/python/src/sample_mut_uninit.rs @@ -15,6 +15,7 @@ use core::mem::MaybeUninit; use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ header_publish_subscribe::HeaderPublishSubscribe, @@ -44,6 +45,7 @@ pub(crate) enum SampleMutUninitType { ), } +#[gen_stub_pyclass] #[pyclass] /// Acquired by a `Publisher` via /// * `Publisher::loan_uninit()` @@ -57,6 +59,7 @@ pub struct SampleMutUninit { pub(crate) user_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl SampleMutUninit { #[getter] diff --git a/iceoryx2-ffi/python/src/server.rs b/iceoryx2-ffi/python/src/server.rs index a5c2d70b1c..19db511726 100644 --- a/iceoryx2-ffi/python/src/server.rs +++ b/iceoryx2-ffi/python/src/server.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ active_request::{ActiveRequest, ActiveRequestType}, @@ -43,6 +44,7 @@ pub(crate) enum ServerType { Local(Option), } +#[gen_stub_pyclass] #[pyclass] /// Represents the receiving endpoint of an event based communication. pub struct Server { @@ -53,6 +55,7 @@ pub struct Server { pub(crate) response_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Server { #[getter] diff --git a/iceoryx2-ffi/python/src/service.rs b/iceoryx2-ffi/python/src/service.rs index c980f9276f..e063163289 100644 --- a/iceoryx2-ffi/python/src/service.rs +++ b/iceoryx2-ffi/python/src/service.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ config::Config, @@ -21,10 +22,12 @@ use crate::{ service_type::ServiceType, }; +#[gen_stub_pyclass] #[pyclass] /// Builder to create or open `Service`s pub struct Service(()); +#[gen_stub_pymethods] #[pymethods] impl Service { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/service_builder.rs b/iceoryx2-ffi/python/src/service_builder.rs index 7e1e3fd1c9..93d0eb6a9a 100644 --- a/iceoryx2-ffi/python/src/service_builder.rs +++ b/iceoryx2-ffi/python/src/service_builder.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::service_builder_request_response::ServiceBuilderRequestResponseType; use crate::{ @@ -27,10 +28,12 @@ pub(crate) enum ServiceBuilderType { Local(iceoryx2::service::builder::Builder), } +#[gen_stub_pyclass] #[pyclass] /// Builder to create or open `Service`s pub struct ServiceBuilder(pub(crate) ServiceBuilderType); +#[gen_stub_pymethods] #[pymethods] impl ServiceBuilder { /// Create a new builder to create a `MessagingPattern::Event` `Service`. diff --git a/iceoryx2-ffi/python/src/service_builder_event.rs b/iceoryx2-ffi/python/src/service_builder_event.rs index 3cfe498eca..0e8bb159d1 100644 --- a/iceoryx2-ffi/python/src/service_builder_event.rs +++ b/iceoryx2-ffi/python/src/service_builder_event.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ attribute_specifier::AttributeSpecifier, @@ -27,10 +28,12 @@ pub(crate) enum ServiceBuilderEventType { Local(iceoryx2::service::builder::event::Builder), } +#[gen_stub_pyclass] #[pyclass] /// Builder to create new `MessagingPattern::Event` based `Service`s pub struct ServiceBuilderEvent(pub(crate) ServiceBuilderEventType); +#[gen_stub_pymethods] #[pymethods] impl ServiceBuilderEvent { /// Enables the deadline property of the service. There must be a notification emitted by any diff --git a/iceoryx2-ffi/python/src/service_builder_publish_subscribe.rs b/iceoryx2-ffi/python/src/service_builder_publish_subscribe.rs index 86d373ceab..30307fba01 100644 --- a/iceoryx2-ffi/python/src/service_builder_publish_subscribe.rs +++ b/iceoryx2-ffi/python/src/service_builder_publish_subscribe.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::alignment::Alignment; use crate::attribute_specifier::AttributeSpecifier; @@ -42,6 +43,7 @@ pub(crate) enum ServiceBuilderPublishSubscribeType { Local(LocalBuilder), } +#[gen_stub_pyclass] #[pyclass] /// Builder to create new `MessagingPattern::PublishSubscribe` based `Service`s pub struct ServiceBuilderPublishSubscribe { @@ -76,6 +78,7 @@ impl ServiceBuilderPublishSubscribe { } } +#[gen_stub_pymethods] #[pymethods] impl ServiceBuilderPublishSubscribe { pub fn __set_payload_type(&mut self, value: PyObject) { diff --git a/iceoryx2-ffi/python/src/service_builder_request_response.rs b/iceoryx2-ffi/python/src/service_builder_request_response.rs index cf2d14b8eb..6b7e7fcbc9 100644 --- a/iceoryx2-ffi/python/src/service_builder_request_response.rs +++ b/iceoryx2-ffi/python/src/service_builder_request_response.rs @@ -12,6 +12,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::alignment::Alignment; use crate::attribute_specifier::AttributeSpecifier; @@ -48,6 +49,7 @@ pub(crate) enum ServiceBuilderRequestResponseType { Local(LocalBuilder), } +#[gen_stub_pyclass] #[pyclass] /// Builder to create new `MessagingPattern::RequestResponse` based `Service`s pub struct ServiceBuilderRequestResponse { @@ -90,6 +92,7 @@ impl ServiceBuilderRequestResponse { } } +#[gen_stub_pymethods] #[pymethods] impl ServiceBuilderRequestResponse { pub fn __set_request_payload_type(&mut self, value: PyObject) { diff --git a/iceoryx2-ffi/python/src/service_details.rs b/iceoryx2-ffi/python/src/service_details.rs index d1c27e7836..78a2e22ff6 100644 --- a/iceoryx2-ffi/python/src/service_details.rs +++ b/iceoryx2-ffi/python/src/service_details.rs @@ -12,6 +12,7 @@ use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ attribute_set::AttributeSet, @@ -28,10 +29,12 @@ pub(crate) enum ServiceDetailsType { Local(iceoryx2::service::ServiceDetails), } +#[gen_stub_pyclass] #[pyclass(str = "{0:#?}")] /// Represents all the `Service` information that one can acquire with `Service::list()`. pub struct ServiceDetails(pub(crate) ServiceDetailsType); +#[gen_stub_pymethods] #[pymethods] impl ServiceDetails { /// A list of all `Node`s that are registered at the `Service` diff --git a/iceoryx2-ffi/python/src/service_id.rs b/iceoryx2-ffi/python/src/service_id.rs index 4c40e2073d..a80065864d 100644 --- a/iceoryx2-ffi/python/src/service_id.rs +++ b/iceoryx2-ffi/python/src/service_id.rs @@ -11,11 +11,14 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass] /// The unique id of a `Service` pub struct ServiceId(pub(crate) iceoryx2::service::service_id::ServiceId); +#[gen_stub_pymethods] #[pymethods] impl ServiceId { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/service_name.rs b/iceoryx2-ffi/python/src/service_name.rs index ed8146184c..ac956cb1cb 100644 --- a/iceoryx2-ffi/python/src/service_name.rs +++ b/iceoryx2-ffi/python/src/service_name.rs @@ -12,7 +12,9 @@ use crate::error::SemanticStringError; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq)] /// Relocatable (inter-process shared memory compatible) `SemanticString` implementation for @@ -21,6 +23,7 @@ use pyo3::prelude::*; /// path or file name length the system supports can be stored. pub struct ServiceName(pub(crate) iceoryx2::prelude::ServiceName); +#[gen_stub_pymethods] #[pymethods] impl ServiceName { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/service_type.rs b/iceoryx2-ffi/python/src/service_type.rs index 3615db5c57..5e2bb8cef5 100644 --- a/iceoryx2-ffi/python/src/service_type.rs +++ b/iceoryx2-ffi/python/src/service_type.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// Defines the type of the `Service` and what kind of resources and operating system mechanisms @@ -26,6 +28,7 @@ pub enum ServiceType { pub(crate) type IpcService = iceoryx2::prelude::ipc_threadsafe::Service; pub(crate) type LocalService = iceoryx2::prelude::local_threadsafe::Service; +#[gen_stub_pymethods] #[pymethods] impl ServiceType { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/signal_handling_mode.rs b/iceoryx2-ffi/python/src/signal_handling_mode.rs index 644fa57b3e..eda41b452b 100644 --- a/iceoryx2-ffi/python/src/signal_handling_mode.rs +++ b/iceoryx2-ffi/python/src/signal_handling_mode.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// Defines how signals are handled by constructs that might register a custom @@ -24,6 +26,7 @@ pub enum SignalHandlingMode { Disabled, } +#[gen_stub_pymethods] #[pymethods] impl SignalHandlingMode { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/static_config_event.rs b/iceoryx2-ffi/python/src/static_config_event.rs index 03625bdd49..0bb8e9715b 100644 --- a/iceoryx2-ffi/python/src/static_config_event.rs +++ b/iceoryx2-ffi/python/src/static_config_event.rs @@ -11,15 +11,18 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{duration::Duration, event_id::EventId}; +#[gen_stub_pyclass] #[pyclass] /// The static configuration of an `MessagingPattern::Event` /// based service. Contains all parameters that do not change during the lifetime of a /// `Service`. pub struct StaticConfigEvent(pub(crate) iceoryx2::service::static_config::event::StaticConfig); +#[gen_stub_pymethods] #[pymethods] impl StaticConfigEvent { #[getter] diff --git a/iceoryx2-ffi/python/src/static_config_publish_subscribe.rs b/iceoryx2-ffi/python/src/static_config_publish_subscribe.rs index 3deb8ed678..7ed83790d8 100644 --- a/iceoryx2-ffi/python/src/static_config_publish_subscribe.rs +++ b/iceoryx2-ffi/python/src/static_config_publish_subscribe.rs @@ -11,9 +11,11 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::message_type_details::MessageTypeDetails; +#[gen_stub_pyclass] #[pyclass] /// The static configuration of an `MessagingPattern::PublishSubscribe` based `Service`. Contains /// all parameters that do not change during the lifetime of a `Service`. @@ -21,6 +23,7 @@ pub struct StaticConfigPublishSubscribe( pub(crate) iceoryx2::service::static_config::publish_subscribe::StaticConfig, ); +#[gen_stub_pymethods] #[pymethods] impl StaticConfigPublishSubscribe { #[getter] diff --git a/iceoryx2-ffi/python/src/static_config_request_response.rs b/iceoryx2-ffi/python/src/static_config_request_response.rs index 9b2bef040f..262738cfda 100644 --- a/iceoryx2-ffi/python/src/static_config_request_response.rs +++ b/iceoryx2-ffi/python/src/static_config_request_response.rs @@ -11,9 +11,11 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::message_type_details::MessageTypeDetails; +#[gen_stub_pyclass] #[pyclass] /// The static configuration of an `MessagingPattern::RequestResponse` based service. Contains all /// parameters that do not change during the lifetime of a `Service`. @@ -21,6 +23,7 @@ pub struct StaticConfigRequestResponse( pub(crate) iceoryx2::service::static_config::request_response::StaticConfig, ); +#[gen_stub_pymethods] #[pymethods] impl StaticConfigRequestResponse { #[getter] diff --git a/iceoryx2-ffi/python/src/stubgen.rs b/iceoryx2-ffi/python/src/stubgen.rs new file mode 100644 index 0000000000..8212332d89 --- /dev/null +++ b/iceoryx2-ffi/python/src/stubgen.rs @@ -0,0 +1,9 @@ +use _iceoryx2; +use pyo3_stub_gen::Result; + +fn main() -> Result<()> { + let stub = _iceoryx2::stub_info()?; + stub.generate()?; + + Ok(()) +} diff --git a/iceoryx2-ffi/python/src/subscriber.rs b/iceoryx2-ffi/python/src/subscriber.rs index ce3a53551d..b8553a40d3 100644 --- a/iceoryx2-ffi/python/src/subscriber.rs +++ b/iceoryx2-ffi/python/src/subscriber.rs @@ -13,6 +13,7 @@ use iceoryx2::service::builder::{CustomHeaderMarker, CustomPayloadMarker}; use iceoryx2_bb_log::fatal_panic; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::{ConnectionFailure, ReceiveError}, @@ -43,6 +44,7 @@ pub(crate) enum SubscriberType { ), } +#[gen_stub_pyclass] #[pyclass] /// Represents the receiving endpoint of an event based communication. pub struct Subscriber { @@ -51,6 +53,7 @@ pub struct Subscriber { pub(crate) user_header_type_details: TypeStorage, } +#[gen_stub_pymethods] #[pymethods] impl Subscriber { #[getter] diff --git a/iceoryx2-ffi/python/src/type_detail.rs b/iceoryx2-ffi/python/src/type_detail.rs index c70ce5ec9e..576161d956 100644 --- a/iceoryx2-ffi/python/src/type_detail.rs +++ b/iceoryx2-ffi/python/src/type_detail.rs @@ -11,10 +11,12 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{type_name::TypeName, type_variant::TypeVariant}; use iceoryx2::testing; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] /// Contains all type details required to connect to a `Service` #[derive(PartialEq)] @@ -28,6 +30,7 @@ impl Default for TypeDetail { } } +#[gen_stub_pymethods] #[pymethods] impl TypeDetail { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/type_name.rs b/iceoryx2-ffi/python/src/type_name.rs index d28014da44..050aa2ac47 100644 --- a/iceoryx2-ffi/python/src/type_name.rs +++ b/iceoryx2-ffi/python/src/type_name.rs @@ -12,7 +12,9 @@ use crate::error::SemanticStringError; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(str = "{0:?}", eq)] #[derive(PartialEq, Clone)] /// Represents the string name of a type. The name shall uniquely identify the type in the @@ -21,6 +23,7 @@ pub struct TypeName( pub(crate) iceoryx2::service::static_config::message_type_details::TypeNameString, ); +#[gen_stub_pymethods] #[pymethods] impl TypeName { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/type_storage.rs b/iceoryx2-ffi/python/src/type_storage.rs index c62eef9288..9e790e5d06 100644 --- a/iceoryx2-ffi/python/src/type_storage.rs +++ b/iceoryx2-ffi/python/src/type_storage.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::gen_stub_pyclass; +#[gen_stub_pyclass] #[pyclass] pub struct TypeStorage { pub value: Option, diff --git a/iceoryx2-ffi/python/src/type_variant.rs b/iceoryx2-ffi/python/src/type_variant.rs index 015dc5abee..219e5722b0 100644 --- a/iceoryx2-ffi/python/src/type_variant.rs +++ b/iceoryx2-ffi/python/src/type_variant.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::gen_stub_pyclass_enum; +#[gen_stub_pyclass_enum] #[pyclass] #[derive(PartialEq, Clone, Debug)] /// Defines if the type is a slice with a runtime-size (`TypeVariant::Dynamic`) diff --git a/iceoryx2-ffi/python/src/unable_to_deliver_strategy.rs b/iceoryx2-ffi/python/src/unable_to_deliver_strategy.rs index 62fd8affc1..9c84ab7ebb 100644 --- a/iceoryx2-ffi/python/src/unable_to_deliver_strategy.rs +++ b/iceoryx2-ffi/python/src/unable_to_deliver_strategy.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// Defines the strategy a sender shall pursue when the buffer of the receiver is full @@ -24,6 +26,7 @@ pub enum UnableToDeliverStrategy { DiscardSample, } +#[gen_stub_pymethods] #[pymethods] impl UnableToDeliverStrategy { pub fn __str__(&self) -> String { diff --git a/iceoryx2-ffi/python/src/unique_client_id.rs b/iceoryx2-ffi/python/src/unique_client_id.rs index 77eeb84034..bd58ba2c35 100644 --- a/iceoryx2-ffi/python/src/unique_client_id.rs +++ b/iceoryx2-ffi/python/src/unique_client_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Client`. pub struct UniqueClientId(pub(crate) iceoryx2::port::port_identifiers::UniqueClientId); +#[gen_stub_pymethods] #[pymethods] impl UniqueClientId { #[getter] diff --git a/iceoryx2-ffi/python/src/unique_listener_id.rs b/iceoryx2-ffi/python/src/unique_listener_id.rs index 96db9bae66..4fea4b60f4 100644 --- a/iceoryx2-ffi/python/src/unique_listener_id.rs +++ b/iceoryx2-ffi/python/src/unique_listener_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Listener`. pub struct UniqueListenerId(pub(crate) iceoryx2::port::port_identifiers::UniqueListenerId); +#[gen_stub_pymethods] #[pymethods] impl UniqueListenerId { #[getter] diff --git a/iceoryx2-ffi/python/src/unique_notifier_id.rs b/iceoryx2-ffi/python/src/unique_notifier_id.rs index 4b22ff6487..2cd8d3024d 100644 --- a/iceoryx2-ffi/python/src/unique_notifier_id.rs +++ b/iceoryx2-ffi/python/src/unique_notifier_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Notifier`. pub struct UniqueNotifierId(pub(crate) iceoryx2::port::port_identifiers::UniqueNotifierId); +#[gen_stub_pymethods] #[pymethods] impl UniqueNotifierId { #[getter] diff --git a/iceoryx2-ffi/python/src/unique_publisher_id.rs b/iceoryx2-ffi/python/src/unique_publisher_id.rs index 10993483ca..626a4754b2 100644 --- a/iceoryx2-ffi/python/src/unique_publisher_id.rs +++ b/iceoryx2-ffi/python/src/unique_publisher_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Publisher`. pub struct UniquePublisherId(pub(crate) iceoryx2::port::port_identifiers::UniquePublisherId); +#[gen_stub_pymethods] #[pymethods] impl UniquePublisherId { #[getter] diff --git a/iceoryx2-ffi/python/src/unique_server_id.rs b/iceoryx2-ffi/python/src/unique_server_id.rs index cc86c3a73e..e0a530e91a 100644 --- a/iceoryx2-ffi/python/src/unique_server_id.rs +++ b/iceoryx2-ffi/python/src/unique_server_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Server`. pub struct UniqueServerId(pub(crate) iceoryx2::port::port_identifiers::UniqueServerId); +#[gen_stub_pymethods] #[pymethods] impl UniqueServerId { #[getter] diff --git a/iceoryx2-ffi/python/src/unique_subscriber_id.rs b/iceoryx2-ffi/python/src/unique_subscriber_id.rs index a7d29cce46..9499b45cac 100644 --- a/iceoryx2-ffi/python/src/unique_subscriber_id.rs +++ b/iceoryx2-ffi/python/src/unique_subscriber_id.rs @@ -11,12 +11,15 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; +#[gen_stub_pyclass] #[pyclass(eq, str = "{0:?}")] #[derive(PartialEq, Eq)] /// The system-wide unique id of a `Subscriber`. pub struct UniqueSubscriberId(pub(crate) iceoryx2::port::port_identifiers::UniqueSubscriberId); +#[gen_stub_pymethods] #[pymethods] impl UniqueSubscriberId { #[getter] diff --git a/iceoryx2-ffi/python/src/waitset.rs b/iceoryx2-ffi/python/src/waitset.rs index ade842a648..8da5175de2 100644 --- a/iceoryx2-ffi/python/src/waitset.rs +++ b/iceoryx2-ffi/python/src/waitset.rs @@ -13,6 +13,7 @@ use core::ops::Deref; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ duration::Duration, @@ -31,6 +32,7 @@ pub(crate) enum WaitSetType { Local(iceoryx2::waitset::WaitSet), } +#[gen_stub_pyclass] #[pyclass] /// The `WaitSet` implements a reactor pattern and allows to wait on multiple events in one /// single call `WaitSet::wait_and_process()` until a interrupt or termination signal was received. @@ -40,6 +42,7 @@ pub(crate) enum WaitSetType { /// Can be created via the `WaitSetBuilder`. pub struct WaitSet(pub(crate) Parc); +#[gen_stub_pymethods] #[pymethods] impl WaitSet { /// Attaches a `Listener` as notification to the `WaitSet`. Whenever an event is received on the diff --git a/iceoryx2-ffi/python/src/waitset_attachment_id.rs b/iceoryx2-ffi/python/src/waitset_attachment_id.rs index fc5683e684..c3cd6e8dd4 100644 --- a/iceoryx2-ffi/python/src/waitset_attachment_id.rs +++ b/iceoryx2-ffi/python/src/waitset_attachment_id.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::waitset_guard::{WaitSetGuard, WaitSetGuardType}; @@ -21,10 +22,12 @@ pub(crate) enum WaitSetAttachmentIdType { } #[derive(PartialEq, Eq, Hash)] +#[gen_stub_pyclass] #[pyclass(eq, hash, frozen)] /// Represents an attachment to the `WaitSet` pub struct WaitSetAttachmentId(pub(crate) WaitSetAttachmentIdType); +#[gen_stub_pymethods] #[pymethods] impl WaitSetAttachmentId { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/waitset_builder.rs b/iceoryx2-ffi/python/src/waitset_builder.rs index a549f992e5..235190c74c 100644 --- a/iceoryx2-ffi/python/src/waitset_builder.rs +++ b/iceoryx2-ffi/python/src/waitset_builder.rs @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{ error::WaitSetCreateError, @@ -21,10 +22,12 @@ use crate::{ }; #[derive(Default)] +#[gen_stub_pyclass] #[pyclass(str = "{0:?}")] /// Creates a new `WaitSet`. pub struct WaitSetBuilder(iceoryx2::prelude::WaitSetBuilder); +#[gen_stub_pymethods] #[pymethods] impl WaitSetBuilder { #[staticmethod] diff --git a/iceoryx2-ffi/python/src/waitset_guard.rs b/iceoryx2-ffi/python/src/waitset_guard.rs index 822c985222..3db018d2e0 100644 --- a/iceoryx2-ffi/python/src/waitset_guard.rs +++ b/iceoryx2-ffi/python/src/waitset_guard.rs @@ -14,6 +14,7 @@ use core::any::Any; use std::sync::Arc; use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass, gen_stub_pymethods}; use crate::{parc::Parc, waitset::WaitSetType}; @@ -31,11 +32,13 @@ pub(crate) enum WaitSetGuardType { Local(StorageType), } +#[gen_stub_pyclass] #[pyclass] /// Is returned when something is attached to the `WaitSet`. As soon as it goes out /// of scope, the attachment is detached. pub struct WaitSetGuard(pub(crate) WaitSetGuardType); +#[gen_stub_pymethods] #[pymethods] impl WaitSetGuard { /// Drops the `WaitSetGuard`. After this call the `WaitSetGuard` is no longer usable. diff --git a/iceoryx2-ffi/python/src/waitset_run_result.rs b/iceoryx2-ffi/python/src/waitset_run_result.rs index 8384a9cbb0..7754fe6652 100644 --- a/iceoryx2-ffi/python/src/waitset_run_result.rs +++ b/iceoryx2-ffi/python/src/waitset_run_result.rs @@ -11,7 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 OR MIT use pyo3::prelude::*; +use pyo3_stub_gen_derive::{gen_stub_pyclass_enum, gen_stub_pymethods}; +#[gen_stub_pyclass_enum] #[pyclass(eq, eq_int)] #[derive(PartialEq, Clone, Debug)] /// States why the `WaitSet::wait_and_process()` method returned. @@ -26,6 +28,7 @@ pub enum WaitSetRunResult { AllEventsHandled, } +#[gen_stub_pymethods] #[pymethods] impl WaitSetRunResult { pub fn __str__(&self) -> String {