diff --git a/Cargo.lock b/Cargo.lock index 50fea794a..2aab79d14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ dependencies = [ "parking_lot", "pin-project-lite 0.2.7", "smallvec", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-util 0.6.7", ] @@ -48,7 +48,7 @@ dependencies = [ "futures-sink", "log", "pin-project-lite 0.2.7", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-util 0.6.7", ] @@ -99,15 +99,15 @@ dependencies = [ "mime", "once_cell", "percent-encoding", - "pin-project 1.0.7", + "pin-project 1.0.8", "pin-project-lite 0.2.7", "rand 0.8.4", "regex", - "serde 1.0.126", + "serde 1.0.127", "sha-1", "smallvec", "time 0.2.27", - "tokio 1.8.1", + "tokio 1.9.0", "zstd", ] @@ -129,11 +129,11 @@ dependencies = [ "futures-core", "http", "log", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_urlencoded 0.7.0", "slab", - "socket2 0.4.0", + "socket2 0.4.1", "time 0.2.27", ] @@ -144,7 +144,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2f86cd6857c135e6e9fe57b1619a88d1f94a7df34c00e11fe13e64fd3438837" dependencies = [ "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -157,7 +157,7 @@ dependencies = [ "http", "log", "regex", - "serde 1.0.126", + "serde 1.0.127", ] [[package]] @@ -168,7 +168,7 @@ checksum = "bc7d7cd957c9ed92288a7c3c96af81fa5291f65247a76a34dac7b6af74e52ba0" dependencies = [ "actix-macros", "futures-core", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -185,7 +185,7 @@ dependencies = [ "mio 0.7.13", "num_cpus", "slab", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -256,13 +256,13 @@ dependencies = [ "mime", "once_cell", "paste", - "pin-project 1.0.7", + "pin-project 1.0.8", "regex", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_urlencoded 0.7.0", "smallvec", - "socket2 0.4.0", + "socket2 0.4.1", "time 0.2.27", "url", ] @@ -280,8 +280,8 @@ dependencies = [ "bytes 1.0.1", "bytestring", "futures-core", - "pin-project 1.0.7", - "tokio 1.8.1", + "pin-project 1.0.8", + "tokio 1.9.0", ] [[package]] @@ -290,9 +290,9 @@ version = "0.5.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d048c6986743105c1e8e9729fbc8d5d1667f2f62393a58be8d85a7d9a5a6c8d" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -301,16 +301,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "addr2line" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" dependencies = [ "gimli", ] @@ -398,9 +398,9 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -419,20 +419,20 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "async-trait" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" +checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -474,7 +474,7 @@ dependencies = [ "percent-encoding", "pin-project-lite 0.2.7", "rand 0.8.4", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_urlencoded 0.7.0", ] @@ -488,15 +488,15 @@ dependencies = [ "futures-core", "getrandom", "instant", - "pin-project 1.0.7", + "pin-project 1.0.8", "rand 0.8.4", ] [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" dependencies = [ "addr2line", "cc", @@ -666,7 +666,7 @@ dependencies = [ "futures-util", "memchr", "pin-project-lite 0.2.7", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -678,7 +678,7 @@ dependencies = [ "lazy_static", "nom", "rust-ini", - "serde 1.0.126", + "serde 1.0.127", "serde-hjson", "serde_json", "toml", @@ -805,7 +805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -839,11 +839,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebf7a94fedf6f251d5cb208ea536496a191c552509a052976af59792199cbc8" dependencies = [ "inflections", - "itertools", - "proc-macro2 1.0.27", + "itertools 0.9.0", + "proc-macro2 1.0.28", "quote 1.0.9", "regex", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -853,7 +853,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed431abf442833fd62ad7cc527a3833d969155c803f0dcf7f8a68db8adddc4c5" dependencies = [ "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -884,10 +884,10 @@ checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", "strsim 0.10.0", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -898,10 +898,10 @@ checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", "strsim 0.10.0", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -912,7 +912,7 @@ checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core 0.12.4", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -923,7 +923,7 @@ checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ "darling_core 0.13.0", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -934,13 +934,13 @@ checksum = "42fe64308f2072bb94ecd8f7557f9ac01b69d86e6199bac24be0f091ad74b092" [[package]] name = "deadpool" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6284d3fbd2821de00878c70e55e89859c3115c4cacbd63a8dbd56887e88d069f" +checksum = "ef82259c587bceda08349f28ff00f69ae4c897898f254140af6021eb218e8232" dependencies = [ "async-trait", "num_cpus", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -961,9 +961,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -982,9 +982,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" dependencies = [ "darling 0.12.4", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -994,7 +994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -1004,10 +1004,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" dependencies = [ "convert_case", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", "rustc_version 0.3.3", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -1111,9 +1111,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "synstructure", ] @@ -1128,13 +1128,13 @@ dependencies = [ "futures-core", "futures-util", "http", - "hyper 0.14.10", + "hyper 0.14.11", "hyper-tls", "mime", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "time 0.2.27", - "tokio 1.8.1", + "tokio 1.9.0", "url", "webdriver", ] @@ -1247,9 +1247,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" +checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b" dependencies = [ "futures-channel", "futures-core", @@ -1262,9 +1262,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" +checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9" dependencies = [ "futures-core", "futures-sink", @@ -1272,15 +1272,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" +checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99" [[package]] name = "futures-executor" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" +checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c" dependencies = [ "futures-core", "futures-task", @@ -1289,34 +1289,34 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" +checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582" [[package]] name = "futures-macro" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" +checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57" dependencies = [ "autocfg", "proc-macro-hack", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "futures-sink" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" +checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53" [[package]] name = "futures-task" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" +checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2" [[package]] name = "futures-timer" @@ -1326,9 +1326,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" +checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78" dependencies = [ "autocfg", "futures-channel", @@ -1383,9 +1383,9 @@ dependencies = [ "heck", "peg", "quote 1.0.9", - "serde 1.0.126", + "serde 1.0.127", "serde_json", - "syn 1.0.73", + "syn 1.0.74", "textwrap 0.12.1", "thiserror", "typed-builder", @@ -1397,16 +1397,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "gimli" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "globset" @@ -1466,7 +1466,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-util 0.6.7", "tracing", ] @@ -1583,7 +1583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac34a56cfd4acddb469cc7fff187ed5ac36f498ba085caf8bbc725e3ff474058" dependencies = [ "humantime", - "serde 1.0.126", + "serde 1.0.127", ] [[package]] @@ -1602,7 +1602,7 @@ dependencies = [ "httparse", "httpdate 0.3.2", "itoa", - "pin-project 1.0.7", + "pin-project 1.0.8", "socket2 0.3.19", "tokio 0.2.25", "tower-service", @@ -1612,9 +1612,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.10" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7728a72c4c7d72665fde02204bcbd93b247721025b222ef78606f14513e0fd03" +checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11" dependencies = [ "bytes 1.0.1", "futures-channel", @@ -1627,13 +1627,25 @@ dependencies = [ "httpdate 1.0.1", "itoa", "pin-project-lite 0.2.7", - "socket2 0.4.0", - "tokio 1.8.1", + "socket2 0.4.1", + "tokio 1.9.0", "tower-service", "tracing", "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper 0.14.11", + "pin-project-lite 0.2.7", + "tokio 1.9.0", + "tokio-io-timeout", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -1641,9 +1653,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.10", + "hyper 0.14.11", "native-tls", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-native-tls", ] @@ -1727,9 +1739,9 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c094e94816723ab936484666968f5b58060492e880f3c8d00489a1e244fa51" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -1756,6 +1768,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" @@ -1895,7 +1916,7 @@ dependencies = [ "function_name", "futures", "humantime-serde", - "hyper 0.14.10", + "hyper 0.14.11", "lazy_static", "medea-client-api-proto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "medea-control-api-proto", @@ -1906,7 +1927,7 @@ dependencies = [ "redis", "rust-argon2", "rust-crypto", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_yaml", "serial_test", @@ -1919,7 +1940,7 @@ dependencies = [ "smart-default", "subtle", "tempfile", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-stream", "tokio-util 0.6.7", "toml", @@ -1934,7 +1955,7 @@ dependencies = [ "async-trait", "derive_more", "medea-macro 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_with", ] @@ -1948,7 +1969,7 @@ dependencies = [ "async-trait", "derive_more", "medea-macro 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_with", ] @@ -1967,7 +1988,7 @@ dependencies = [ "humantime-serde", "medea-control-api-proto", "protobuf", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "slog", "slog-async", @@ -2000,7 +2021,7 @@ dependencies = [ "futures", "once_cell", "regex", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-util 0.6.7", ] @@ -2017,9 +2038,9 @@ dependencies = [ "medea-control-api-mock", "once_cell", "reqwest", - "serde 1.0.126", + "serde 1.0.127", "serde_json", - "tokio 1.8.1", + "tokio 1.9.0", "uuid", "webdriver", ] @@ -2051,7 +2072,7 @@ dependencies = [ "medea-reactive 0.1.1", "mockall", "predicates-tree", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "tracerr", "url", @@ -2070,9 +2091,9 @@ dependencies = [ "Inflector", "async-trait", "medea-jason", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "synstructure", ] @@ -2083,9 +2104,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dde37d05168bd518badb18c9279d1582a34f66fb796d9422b2adc1b798d9a52d" dependencies = [ "Inflector", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "synstructure", ] @@ -2103,7 +2124,7 @@ name = "medea-reactive" version = "0.1.2-dev" dependencies = [ "futures", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -2219,9 +2240,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7e25b214433f669161f414959594216d8e6ba83b6679d3db96899c0b4639033" dependencies = [ "cfg-if 1.0.0", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -2325,9 +2346,9 @@ dependencies = [ [[package]] name = "object" -version = "0.25.3" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386" dependencies = [ "memchr", ] @@ -2431,7 +2452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "636d60acf97633e48d266d7415a9355d4389cea327a193f87df395d88cd2b14d" dependencies = [ "peg-runtime", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", ] @@ -2477,11 +2498,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" +checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" dependencies = [ - "pin-project-internal 1.0.7", + "pin-project-internal 1.0.8", ] [[package]] @@ -2490,20 +2511,20 @@ version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "pin-project-internal" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" +checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -2597,18 +2618,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" dependencies = [ "unicode-xid 0.2.2", ] [[package]] name = "prost" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" +checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ "bytes 1.0.1", "prost-derive", @@ -2616,13 +2637,13 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" +checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" dependencies = [ "bytes 1.0.1", "heck", - "itertools", + "itertools 0.10.1", "log", "multimap", "petgraph", @@ -2634,22 +2655,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" +checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" dependencies = [ "anyhow", - "itertools", - "proc-macro2 1.0.27", + "itertools 0.10.1", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "prost-types" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" +checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ "bytes 1.0.1", "prost", @@ -2676,7 +2697,7 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", ] [[package]] @@ -2780,7 +2801,7 @@ dependencies = [ "itoa", "percent-encoding", "pin-project-lite 0.2.7", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-util 0.6.7", "url", ] @@ -2843,7 +2864,7 @@ dependencies = [ "futures-util", "http", "http-body 0.4.2", - "hyper 0.14.10", + "hyper 0.14.11", "hyper-tls", "ipnet", "js-sys", @@ -2853,10 +2874,10 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite 0.2.7", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_urlencoded 0.7.0", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-native-tls", "url", "wasm-bindgen", @@ -3032,9 +3053,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" dependencies = [ "serde_derive", ] @@ -3053,24 +3074,24 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" dependencies = [ "itoa", "ryu", - "serde 1.0.126", + "serde 1.0.127", ] [[package]] @@ -3081,7 +3102,7 @@ checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ "dtoa", "itoa", - "serde 1.0.126", + "serde 1.0.127", "url", ] @@ -3094,7 +3115,7 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde 1.0.126", + "serde 1.0.127", ] [[package]] @@ -3104,7 +3125,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad9fdbb69badc8916db738c25efd04f0a65297d26c2f8de4b62e57b8c12bc72" dependencies = [ "rustversion", - "serde 1.0.126", + "serde 1.0.127", "serde_with_macros", ] @@ -3115,9 +3136,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1569374bd54623ec8bd592cf22ba6e03c0f177ff55fbc8c29a49e296e7adecf" dependencies = [ "darling 0.13.0", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3128,7 +3149,7 @@ checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" dependencies = [ "dtoa", "linked-hash-map", - "serde 1.0.126", + "serde 1.0.127", "yaml-rust", ] @@ -3149,16 +3170,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "sha-1" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" +checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" dependencies = [ "block-buffer", "cfg-if 1.0.0", @@ -3206,9 +3227,9 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "slog-async" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60813879f820c85dbc4eabf3269befe374591289019775898d56a81a804fbdc" +checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" dependencies = [ "crossbeam-channel", "slog", @@ -3233,12 +3254,12 @@ dependencies = [ [[package]] name = "slog-json" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" +checksum = "52e9b96fb6b5e80e371423b4aca6656eb537661ce8f82c2697e619f8ca85d043" dependencies = [ "chrono", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "slog", ] @@ -3290,9 +3311,9 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3308,9 +3329,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad" dependencies = [ "libc", "winapi 0.3.9", @@ -3351,11 +3372,11 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "serde 1.0.126", + "serde 1.0.127", "serde_derive", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3365,13 +3386,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "serde 1.0.126", + "serde 1.0.127", "serde_derive", "serde_json", "sha1", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3411,11 +3432,11 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.73" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", "unicode-xid 0.2.2", ] @@ -3426,9 +3447,9 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "unicode-xid 0.2.2", ] @@ -3516,9 +3537,9 @@ version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3572,17 +3593,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", "standback", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] name = "tinyvec" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338" dependencies = [ "tinyvec_macros", ] @@ -3612,9 +3633,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c8b05dc14c75ea83d63dd391100353789f5f24b8b3866542a5e85c8be8e985" +checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" dependencies = [ "autocfg", "bytes 1.0.1", @@ -3630,15 +3651,25 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "tokio-io-timeout" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" +dependencies = [ + "pin-project-lite 0.2.7", + "tokio 1.9.0", +] + [[package]] name = "tokio-macros" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3648,7 +3679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -3659,7 +3690,7 @@ checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f" dependencies = [ "futures-core", "pin-project-lite 0.2.7", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -3687,7 +3718,7 @@ dependencies = [ "futures-sink", "log", "pin-project-lite 0.2.7", - "tokio 1.8.1", + "tokio 1.9.0", ] [[package]] @@ -3696,14 +3727,14 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "serde 1.0.126", + "serde 1.0.127", ] [[package]] name = "tonic" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac42cd97ac6bd2339af5bcabf105540e21e45636ec6fa6aae5e85d44db31be0" +checksum = "b584f064fdfc50017ec39162d5aebce49912f1eb16fd128e04b7f4ce4907c7e5" dependencies = [ "async-stream", "async-trait", @@ -3714,15 +3745,17 @@ dependencies = [ "h2 0.3.3", "http", "http-body 0.4.2", - "hyper 0.14.10", + "hyper 0.14.11", + "hyper-timeout", "percent-encoding", - "pin-project 1.0.7", + "pin-project 1.0.8", "prost", "prost-derive", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-stream", "tokio-util 0.6.7", "tower", + "tower-layer", "tower-service", "tracing", "tracing-futures", @@ -3730,14 +3763,14 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695de27302f4697191dda1c7178131a8cb805463dda02864acb80fe1322fdcf" +checksum = "d12faebbe071b06f486be82cc9318350814fdd07fcb28f3690840cd770599283" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "prost-build", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3749,10 +3782,10 @@ dependencies = [ "futures-core", "futures-util", "indexmap", - "pin-project 1.0.7", + "pin-project 1.0.8", "rand 0.8.4", "slab", - "tokio 1.8.1", + "tokio 1.9.0", "tokio-stream", "tokio-util 0.6.7", "tower-layer", @@ -3800,9 +3833,9 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3820,7 +3853,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.7", + "pin-project 1.0.8", "tracing", ] @@ -3842,9 +3875,9 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f85f4270f4f449a3f2c0cf2aecc8415e388a597aeacc7d55fc749c5c968c8533" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", ] [[package]] @@ -3992,7 +4025,7 @@ dependencies = [ "mime_guess", "pin-project 0.4.28", "scoped-tls", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "serde_urlencoded 0.6.1", "tokio 0.2.25", @@ -4015,7 +4048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ "cfg-if 1.0.0", - "serde 1.0.126", + "serde 1.0.127", "serde_json", "wasm-bindgen-macro", ] @@ -4029,9 +4062,9 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "wasm-bindgen-shared", ] @@ -4063,9 +4096,9 @@ version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", - "syn 1.0.73", + "syn 1.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4096,7 +4129,7 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd4543fc6cf3541ef0d98bf720104cc6bd856d7eba449fd2aa365ef4fed0e782" dependencies = [ - "proc-macro2 1.0.27", + "proc-macro2 1.0.28", "quote 1.0.9", ] @@ -4132,7 +4165,7 @@ dependencies = [ "cookie 0.12.0", "http", "log", - "serde 1.0.126", + "serde 1.0.127", "serde_derive", "serde_json", "time 0.1.43", @@ -4156,11 +4189,12 @@ dependencies = [ [[package]] name = "which" -version = "4.1.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" dependencies = [ "either", + "lazy_static", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index cfe28a30a..a0f0b7442 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ smart-default = "0.6" subtle = { version = "2.2", default-features = false } tokio = { version = "1.5", features = ["signal", "time"] } toml = "0.5" -tonic = "0.4" +tonic = "0.5" url = "2.1" [dependencies.deadpool] version = "0.8" diff --git a/crates/medea-macro/src/dispatchable.rs b/crates/medea-macro/src/dispatchable.rs index a298ee8b2..a37c97d8f 100644 --- a/crates/medea-macro/src/dispatchable.rs +++ b/crates/medea-macro/src/dispatchable.rs @@ -330,7 +330,7 @@ pub fn expand(item: Item, args: &Args) -> TokenStream { let handler_kind = args.dispatch_with_handler_arg(); let method_doc = item.dispatch_with_method_doc(); - let handler_trait = item.handler_trait(&args); + let handler_trait = item.handler_trait(args); let maybe_async = args.maybe_async_token(); let maybe_await = args.maybe_await_token(); let orig_enum = item.orig_enum; diff --git a/crates/medea-reactive/src/field/mod.rs b/crates/medea-reactive/src/field/mod.rs index 06d761cb1..aab4b40f6 100644 --- a/crates/medea-reactive/src/field/mod.rs +++ b/crates/medea-reactive/src/field/mod.rs @@ -379,7 +379,7 @@ where #[inline] fn deref(&self) -> &Self::Target { - &self.data + self.data } } @@ -402,7 +402,7 @@ where #[inline] fn drop(&mut self) { if self.data != &self.value_before_mutation { - self.subs.on_modify(&self.data); + self.subs.on_modify(self.data); } } } diff --git a/crates/medea-reactive/src/subscribers_store/progressable/processed.rs b/crates/medea-reactive/src/subscribers_store/progressable/processed.rs index b7f8b485b..5a590c030 100644 --- a/crates/medea-reactive/src/subscribers_store/progressable/processed.rs +++ b/crates/medea-reactive/src/subscribers_store/progressable/processed.rs @@ -24,6 +24,7 @@ where I: IntoIterator>, T: 'static, { + #[allow(clippy::needless_collect)] let futures: Vec<_> = futures.into_iter().collect(); AllProcessed::new(Box::new(move || { let futures = futures.iter().map(AsRef::as_ref).map(|f| f()); diff --git a/jason/src/api/dart/audio_track_constraints.rs b/jason/src/api/dart/audio_track_constraints.rs index 222bd8e6c..5c801caf3 100644 --- a/jason/src/api/dart/audio_track_constraints.rs +++ b/jason/src/api/dart/audio_track_constraints.rs @@ -23,7 +23,7 @@ pub unsafe extern "C" fn AudioTrackConstraints__device_id( mut this: ptr::NonNull, device_id: ptr::NonNull, ) { - this.as_mut().device_id(c_str_into_string(device_id)) + this.as_mut().device_id(c_str_into_string(device_id)); } /// Frees the data behind the provided pointer. diff --git a/jason/src/api/dart/reconnect_handle.rs b/jason/src/api/dart/reconnect_handle.rs index d1521a3a0..46a9a404f 100644 --- a/jason/src/api/dart/reconnect_handle.rs +++ b/jason/src/api/dart/reconnect_handle.rs @@ -65,7 +65,7 @@ impl From> for DartError { SE::AuthorizationFailed => Some(Kind::AuthorizationFailed), SE::ConnectionLost(reason) => { if let Reason::ConnectError(err) = reason { - cause = err.into_inner().js_cause() + cause = err.into_inner().js_cause(); }; Some(Kind::ConnectionLost) } diff --git a/jason/src/api/wasm/local_media_track.rs b/jason/src/api/wasm/local_media_track.rs index 6ad640a12..8820b62ed 100644 --- a/jason/src/api/wasm/local_media_track.rs +++ b/jason/src/api/wasm/local_media_track.rs @@ -27,7 +27,7 @@ impl LocalMediaTrack { /// [1]: https://w3.org/TR/mediacapture-streams#dom-mediastreamtrack #[must_use] pub fn get_track(&self) -> web_sys::MediaStreamTrack { - Clone::clone(&self.0.get_track().as_ref()) + Clone::clone(self.0.get_track().as_ref()) } /// Returns a [`MediaKind::Audio`] if this [`LocalMediaTrack`] represents an diff --git a/jason/src/api/wasm/media_stream_settings.rs b/jason/src/api/wasm/media_stream_settings.rs index 301e054bb..8212e9892 100644 --- a/jason/src/api/wasm/media_stream_settings.rs +++ b/jason/src/api/wasm/media_stream_settings.rs @@ -29,7 +29,7 @@ impl MediaStreamSettings { /// /// [1]: https://w3.org/TR/mediacapture-streams#mediastreamtrack pub fn audio(&mut self, constraints: AudioTrackConstraints) { - self.0.audio(constraints.into()) + self.0.audio(constraints.into()); } /// Set constraints that will be used to obtain a local video sourced from @@ -103,14 +103,14 @@ impl DeviceVideoTrackConstraints { /// /// [1]: https://w3.org/TR/mediacapture-streams#dom-constraindomstring pub fn ideal_facing_mode(&mut self, facing_mode: FacingMode) { - self.0.ideal_facing_mode(facing_mode.into()) + self.0.ideal_facing_mode(facing_mode.into()); } /// Sets an exact [`height`][1] constraint. /// /// [1]: https://tinyurl.com/w3-streams#def-constraint-height pub fn exact_height(&mut self, height: u32) { - self.0.exact_height(height) + self.0.exact_height(height); } /// Sets an ideal [`height`][1] constraint. diff --git a/jason/src/api/wasm/remote_media_track.rs b/jason/src/api/wasm/remote_media_track.rs index 0c5d13e3b..507c22f29 100644 --- a/jason/src/api/wasm/remote_media_track.rs +++ b/jason/src/api/wasm/remote_media_track.rs @@ -41,12 +41,12 @@ impl RemoteMediaTrack { /// Sets callback, invoked when this [`RemoteMediaTrack`] is enabled. pub fn on_enabled(&self, cb: js_sys::Function) { - self.0.on_enabled(cb.into()) + self.0.on_enabled(cb.into()); } /// Sets callback, invoked when this [`RemoteMediaTrack`] is disabled. pub fn on_disabled(&self, cb: js_sys::Function) { - self.0.on_disabled(cb.into()) + self.0.on_disabled(cb.into()); } /// Sets callback to invoke when this [`RemoteMediaTrack`] is muted. diff --git a/jason/src/media/constraints.rs b/jason/src/media/constraints.rs index e440febfc..2cda6322b 100644 --- a/jason/src/media/constraints.rs +++ b/jason/src/media/constraints.rs @@ -109,14 +109,14 @@ impl LocalTracksConstraints { &self, settings: &MediaStreamSettings, ) -> LocalStreamUpdateCriteria { - self.0.borrow().calculate_kinds_diff(&settings) + self.0.borrow().calculate_kinds_diff(settings) } /// Constrains the underlying [`MediaStreamSettings`] with the given `other` /// [`MediaStreamSettings`]. #[inline] pub fn constrain(&self, other: MediaStreamSettings) { - self.0.borrow_mut().constrain(other) + self.0.borrow_mut().constrain(other); } /// Clones the underlying [`MediaStreamSettings`]. @@ -150,7 +150,7 @@ impl LocalTracksConstraints { ) { self.0 .borrow_mut() - .set_media_exchange_state_by_kinds(state, kinds) + .set_media_exchange_state_by_kinds(state, kinds); } /// Indicates whether provided [`MediaType`] is enabled in the underlying diff --git a/jason/src/peer/media/mod.rs b/jason/src/peer/media/mod.rs index a8c13fc8f..75ac46700 100644 --- a/jason/src/peer/media/mod.rs +++ b/jason/src/peer/media/mod.rs @@ -631,7 +631,7 @@ impl MediaConnections { { if let Some(mid) = receiver.mid() { if let Some(trnscvr) = inner.peer.get_transceiver_by_mid(&mid) { - receiver.replace_transceiver(trnscvr) + receiver.replace_transceiver(trnscvr); } } } diff --git a/jason/src/peer/media/receiver/component.rs b/jason/src/peer/media/receiver/component.rs index a304d41a8..bb9f03fa5 100644 --- a/jason/src/peer/media/receiver/component.rs +++ b/jason/src/peer/media/receiver/component.rs @@ -346,7 +346,7 @@ impl Component { ) -> Result<(), Infallible> { receiver.muted.set(muted); if let Some(track) = receiver.track.borrow().as_ref() { - track.set_muted(muted) + track.set_muted(muted); } Ok(()) } diff --git a/jason/src/peer/media/transitable_state/controller.rs b/jason/src/peer/media/transitable_state/controller.rs index 6c02fdb4a..6592dfc59 100644 --- a/jason/src/peer/media/transitable_state/controller.rs +++ b/jason/src/peer/media/transitable_state/controller.rs @@ -235,9 +235,9 @@ where pub fn when_stabilized(self: Rc) -> Processed<'static, ()> { Processed::new(Box::new(move || { let stable = self.subscribe_stable(); - Box::pin( - async move { stable.fuse().select_next_some().map(drop).await }, - ) + Box::pin(async move { + stable.fuse().select_next_some().map(drop).await; + }) })) } diff --git a/jason/src/peer/mod.rs b/jason/src/peer/mod.rs index 86264bc02..52ad1db2b 100644 --- a/jason/src/peer/mod.rs +++ b/jason/src/peer/mod.rs @@ -375,7 +375,7 @@ impl PeerConnection { id, &sender, peer_connection_state, - ) + ); }, )); @@ -451,7 +451,7 @@ impl PeerConnection { /// [`Sender`]: sender::Sender #[inline] pub async fn drop_send_tracks(&self, kinds: LocalStreamUpdateCriteria) { - self.media_connections.drop_send_tracks(kinds).await + self.media_connections.drop_send_tracks(kinds).await; } /// Filters out already sent stats, and send new stats from the provided diff --git a/jason/src/peer/stream_update_criteria.rs b/jason/src/peer/stream_update_criteria.rs index 1489784f4..1fc2efc8a 100644 --- a/jason/src/peer/stream_update_criteria.rs +++ b/jason/src/peer/stream_update_criteria.rs @@ -87,7 +87,7 @@ impl LocalStreamUpdateCriteria { #[inline] pub fn add(&mut self, media_kind: MediaKind, source_kind: MediaSourceKind) { self.0 - .bitor_assign(Self::from_kinds(media_kind, Some(source_kind)).0) + .bitor_assign(Self::from_kinds(media_kind, Some(source_kind)).0); } /// Checks whether this [`LocalStreamUpdateCriteria`] contains the provided diff --git a/jason/src/platform/callback.rs b/jason/src/platform/callback.rs index 1d675d372..f29ad8621 100644 --- a/jason/src/platform/callback.rs +++ b/jason/src/platform/callback.rs @@ -27,7 +27,7 @@ impl Callback<()> { #[inline] pub fn call0(&self) { if let Some(f) = self.0.borrow().as_ref() { - f.call0() + f.call0(); }; } } diff --git a/jason/src/platform/dart/constraints.rs b/jason/src/platform/dart/constraints.rs index cbf7cf9cb..596d716ef 100644 --- a/jason/src/platform/dart/constraints.rs +++ b/jason/src/platform/dart/constraints.rs @@ -1,6 +1,6 @@ //! Media tracks and streams constraints functionality. -use derive_more::{AsRef, Into}; +use derive_more::AsRef; use crate::media::{ AudioTrackConstraints, DeviceVideoTrackConstraints, @@ -10,7 +10,7 @@ use crate::media::{ /// [MediaStreamConstraints][1] wrapper. /// /// [1]: https://w3.org/TR/mediacapture-streams/#dom-mediastreamconstraints -#[derive(AsRef, Debug, Into)] +#[derive(AsRef, Debug)] pub struct MediaStreamConstraints; impl MediaStreamConstraints { @@ -49,7 +49,7 @@ impl Default for MediaStreamConstraints { /// [DisplayMediaStreamConstraints][1] wrapper. /// /// [1]: https://w3.org/TR/screen-capture/#dom-displaymediastreamconstraints -#[derive(AsRef, Debug, Into)] +#[derive(AsRef, Debug)] pub struct DisplayMediaStreamConstraints(); impl Default for DisplayMediaStreamConstraints { diff --git a/jason/src/platform/dart/error.rs b/jason/src/platform/dart/error.rs index 2e38d2c51..46b640047 100644 --- a/jason/src/platform/dart/error.rs +++ b/jason/src/platform/dart/error.rs @@ -40,7 +40,9 @@ impl Drop for Error { #[inline] fn drop(&mut self) { if Rc::strong_count(&self.0) == 1 { - unsafe { Dart_DeletePersistentHandle_DL_Trampolined(*self.0) } + unsafe { + Dart_DeletePersistentHandle_DL_Trampolined(*self.0); + } } } } diff --git a/jason/src/platform/dart/executor/mod.rs b/jason/src/platform/dart/executor/mod.rs index f70c6c958..6e8035ebe 100644 --- a/jason/src/platform/dart/executor/mod.rs +++ b/jason/src/platform/dart/executor/mod.rs @@ -72,7 +72,7 @@ pub unsafe extern "C" fn rust_executor_poll_task( /// specific [`Task`]. #[no_mangle] pub unsafe extern "C" fn rust_executor_drop_task(task: ptr::NonNull) { - drop(Rc::from_raw(task.as_ptr())) + drop(Rc::from_raw(task.as_ptr())); } /// Commands an external Dart executor to poll the provided [`Task`]. @@ -94,6 +94,8 @@ fn task_wake(task: ptr::NonNull) { unsafe { Dart_PostCObject_DL_Trampolined(wake_port, &mut task_addr) }; if !enqueued { log::warn!("Could not send message to Dart's native port"); - unsafe { rust_executor_drop_task(task) }; + unsafe { + rust_executor_drop_task(task); + } } } diff --git a/jason/src/platform/dart/media_devices.rs b/jason/src/platform/dart/media_devices.rs index ffe004979..328409439 100644 --- a/jason/src/platform/dart/media_devices.rs +++ b/jason/src/platform/dart/media_devices.rs @@ -20,6 +20,7 @@ use crate::platform::{ /// /// [1]: https://tinyurl.com/w3-streams#dom-mediadevices-enumeratedevices /// [2]: https://w3.org/TR/mediacapture-streams#mediadevices +#[allow(clippy::unused_async)] pub async fn enumerate_devices() -> Result, Traced> { unimplemented!() @@ -37,6 +38,7 @@ pub async fn enumerate_devices() -> Result, Traced> /// /// [1]: https://w3.org/TR/mediacapture-streams#dom-mediadevices-getusermedia /// [2]: https://w3.org/TR/mediacapture-streams#mediadevices +#[allow(clippy::unused_async)] pub async fn get_user_media( caps: MediaStreamConstraints, ) -> Result, Traced> { @@ -56,6 +58,7 @@ pub async fn get_user_media( /// /// [1]: https://w3.org/TR/screen-capture/#dom-mediadevices-getdisplaymedia /// [2]: https://w3.org/TR/mediacapture-streams#mediadevices +#[allow(clippy::unused_async)] pub async fn get_display_media( caps: DisplayMediaStreamConstraints, ) -> Result, Traced> { diff --git a/jason/src/platform/dart/mod.rs b/jason/src/platform/dart/mod.rs index 77ab54e2a..b21f852e5 100644 --- a/jason/src/platform/dart/mod.rs +++ b/jason/src/platform/dart/mod.rs @@ -54,6 +54,7 @@ pub fn init_logger() { /// [`Future`] which resolves after the provided [`Duration`]. /// /// [`Future`]: std::future::Future +#[allow(clippy::unused_async)] pub async fn delay_for(delay: Duration) { unimplemented!() } diff --git a/jason/src/platform/dart/utils/function.rs b/jason/src/platform/dart/utils/function.rs index 9149fb127..9d644c9d4 100644 --- a/jason/src/platform/dart/utils/function.rs +++ b/jason/src/platform/dart/utils/function.rs @@ -96,6 +96,8 @@ impl> Function { impl Drop for Function { /// Manually deallocates saved [`Dart_PersistentHandle`] so it won't leak. fn drop(&mut self) { - unsafe { Dart_DeletePersistentHandle_DL_Trampolined(self.dart_fn) }; + unsafe { + Dart_DeletePersistentHandle_DL_Trampolined(self.dart_fn); + } } } diff --git a/jason/src/platform/wasm/media_track.rs b/jason/src/platform/wasm/media_track.rs index 07b086761..88b62e92e 100644 --- a/jason/src/platform/wasm/media_track.rs +++ b/jason/src/platform/wasm/media_track.rs @@ -173,7 +173,7 @@ impl MediaStreamTrack { /// [3]: https://tinyurl.com/w3-streams#idl-def-MediaStreamTrackState.ended #[inline] pub fn stop(&self) { - self.sys_track.stop() + self.sys_track.stop(); } /// Returns an [`enabled`][1] attribute of the underlying diff --git a/jason/src/platform/wasm/peer_connection.rs b/jason/src/platform/wasm/peer_connection.rs index 7a88d0e06..af8f26154 100644 --- a/jason/src/platform/wasm/peer_connection.rs +++ b/jason/src/platform/wasm/peer_connection.rs @@ -375,7 +375,7 @@ impl RtcPeerConnection { sdp_m_line_index: Option, sdp_mid: &Option, ) -> Result<()> { - let mut cand_init = RtcIceCandidateInit::new(&candidate); + let mut cand_init = RtcIceCandidateInit::new(candidate); cand_init .sdp_m_line_index(sdp_m_line_index) .sdp_mid(sdp_mid.as_ref().map(String::as_ref)); diff --git a/jason/src/platform/wasm/transport.rs b/jason/src/platform/wasm/transport.rs index 2b48dc236..085f943bd 100644 --- a/jason/src/platform/wasm/transport.rs +++ b/jason/src/platform/wasm/transport.rs @@ -80,7 +80,7 @@ struct InnerSocket { impl InnerSocket { fn new(url: &str) -> Result { - let socket = SysWebSocket::new(&url) + let socket = SysWebSocket::new(url) .map_err(Into::into) .map_err(TransportError::CreateSocket) .map_err(tracerr::wrap!())?; diff --git a/jason/src/platform/wasm/utils/function.rs b/jason/src/platform/wasm/utils/function.rs index 20f788327..9b6da1409 100644 --- a/jason/src/platform/wasm/utils/function.rs +++ b/jason/src/platform/wasm/utils/function.rs @@ -12,7 +12,7 @@ impl> Callback { #[inline] pub fn call1>(&self, arg: T) { if let Some(f) = self.0.borrow().as_ref() { - f.call1(arg.into()) + f.call1(arg.into()); }; } } diff --git a/jason/src/room.rs b/jason/src/room.rs index bac2af626..9a619b263 100644 --- a/jason/src/room.rs +++ b/jason/src/room.rs @@ -1150,7 +1150,7 @@ impl InnerRoom { self.recv_constraints.set_enabled(exchange == Enabled, kind); } (Recv, Mute(_)) => { - unreachable!("Receivers muting is not implemented") + unreachable!("Receivers muting is not implemented"); } } } diff --git a/jason/src/rpc/rpc_session.rs b/jason/src/rpc/rpc_session.rs index 2d614a3c7..48e7ffb85 100644 --- a/jason/src/rpc/rpc_session.rs +++ b/jason/src/rpc/rpc_session.rs @@ -373,7 +373,7 @@ impl WebSocketRpcSession { let this = upgrade_or_break!(weak_this); msg.dispatch_with(this.as_ref()); } - }) + }); } } diff --git a/jason/src/rpc/websocket/client.rs b/jason/src/rpc/websocket/client.rs index 056daea16..4f07f8f63 100644 --- a/jason/src/rpc/websocket/client.rs +++ b/jason/src/rpc/websocket/client.rs @@ -315,7 +315,7 @@ impl WebSocketRpcClient { log::error!( "Failed to update socket settings because Heartbeat is \ None", - ) + ); } None } @@ -425,7 +425,7 @@ impl WebSocketRpcClient { platform::spawn(async move { while let Some(msg) = on_socket_message.next().await { if let Some(this) = weak_this.upgrade() { - this.on_transport_message(msg) + this.on_transport_message(msg); } } }); @@ -555,7 +555,7 @@ impl WebSocketRpcClient { /// dropped. #[inline] pub fn set_close_reason(&self, close_reason: ClientDisconnect) { - self.0.borrow_mut().close_reason = close_reason + self.0.borrow_mut().close_reason = close_reason; } } diff --git a/mock/control-api/Cargo.toml b/mock/control-api/Cargo.toml index f13b98f12..7fcc03054 100644 --- a/mock/control-api/Cargo.toml +++ b/mock/control-api/Cargo.toml @@ -32,4 +32,4 @@ slog-scope = "4.3" slog-stdlog = "4.0" slog-term = "2.5" smart-default = "0.6" -tonic = "0.4" +tonic = "0.5" diff --git a/mock/control-api/src/api/ws.rs b/mock/control-api/src/api/ws.rs index df262fd22..717dfaa56 100644 --- a/mock/control-api/src/api/ws.rs +++ b/mock/control-api/src/api/ws.rs @@ -30,6 +30,7 @@ use crate::{ /// Errors if handshake fails for any underlying reason. /// /// [WebSocket]: https://en.wikipedia.org/wiki/WebSocket +#[allow(clippy::unused_async)] pub async fn create_ws( request: HttpRequest, path: Path, @@ -140,7 +141,7 @@ impl Actor for WsSession { if let Some(subs) = self.subscribers.lock().unwrap().get_mut(&self.room_id) { - subs.retain(|sub| *sub != this) + subs.retain(|sub| *sub != this); } } } @@ -187,7 +188,7 @@ impl StreamHandler> for WsSession { msg.clone(), ), )); - }) + }); } } Err(err) => error!( diff --git a/mock/control-api/src/client.rs b/mock/control-api/src/client.rs index 9353141d0..6a7605a81 100644 --- a/mock/control-api/src/client.rs +++ b/mock/control-api/src/client.rs @@ -135,7 +135,7 @@ impl ControlClient { if response.is_ok() { if let Some(subs) = self.subscribers.lock().unwrap().get(&room_id) { for sub in subs { - drop(sub.do_send(notification.clone())) + drop(sub.do_send(notification.clone())); } }; } @@ -204,7 +204,7 @@ impl ControlClient { { let notification = Notification::deleted(&fid); for sub in subs { - drop(sub.do_send(notification.clone())) + drop(sub.do_send(notification.clone())); } }; } diff --git a/proto/control-api/Cargo.toml b/proto/control-api/Cargo.toml index 6b3125ce2..69828bcf0 100644 --- a/proto/control-api/Cargo.toml +++ b/proto/control-api/Cargo.toml @@ -18,9 +18,9 @@ default = ["grpc"] grpc = ["prost", "prost-types", "tonic", "tonic-build"] [dependencies] -prost = { version = "0.7", optional = true } -prost-types = { version = "0.7", optional = true } -tonic = { version = "0.4", optional = true } +prost = { version = "0.8", optional = true } +prost-types = { version = "0.8", optional = true } +tonic = { version = "0.5", optional = true } [build-dependencies] -tonic-build = { version = "0.4", optional = true } +tonic-build = { version = "0.5", optional = true } diff --git a/proto/control-api/build.rs b/proto/control-api/build.rs index 40fb66ac9..0efdbaa7a 100644 --- a/proto/control-api/build.rs +++ b/proto/control-api/build.rs @@ -35,7 +35,7 @@ mod grpc { .iter() .chain(out_files.iter()) .for_each(|filename| { - println!("cargo:rerun-if-changed={}", filename) + println!("cargo:rerun-if-changed={}", filename); }); for filename in &out_files { diff --git a/proto/control-api/src/grpc/api.rs b/proto/control-api/src/grpc/api.rs index f7ac86a7f..014bdece2 100644 --- a/proto/control-api/src/grpc/api.rs +++ b/proto/control-api/src/grpc/api.rs @@ -350,4 +350,4 @@ pub struct WebRtcPlayEndpoint { #[prost(bool, tag="5")] pub force_relay: bool, } -# [doc = r" Generated client implementations."] pub mod control_api_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Media server's Control API service."] pub struct ControlApiClient < T > { inner : tonic :: client :: Grpc < T > , } impl ControlApiClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > ControlApiClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = " Creates new Element with a given ID."] # [doc = ""] # [doc = " Not idempotent. Errors if an Element with the same ID already exists."] pub async fn create (& mut self , request : impl tonic :: IntoRequest < super :: CreateRequest > ,) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Create") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Removes Element by its ID."] # [doc = " Allows referring multiple Elements on the last two levels."] # [doc = ""] # [doc = " Idempotent. If no Elements with such IDs exist, then succeeds."] pub async fn delete (& mut self , request : impl tonic :: IntoRequest < super :: IdRequest > ,) -> Result < tonic :: Response < super :: Response > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Delete") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Returns Element by its ID."] # [doc = " Allows referring multiple Elements."] # [doc = " If no ID specified, returns all Elements declared."] pub async fn get (& mut self , request : impl tonic :: IntoRequest < super :: IdRequest > ,) -> Result < tonic :: Response < super :: GetResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Get") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Applies the given spec to Element by its ID."] # [doc = ""] # [doc = " Idempotent. If no Element with such ID exists, then it will be created,"] # [doc = " otherwise it will be reconfigured. Elements that exist, but are not"] # [doc = " specified in the provided spec will be removed."] pub async fn apply (& mut self , request : impl tonic :: IntoRequest < super :: ApplyRequest > ,) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Apply") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for ControlApiClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for ControlApiClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "ControlApiClient {{ ... }}") } } }# [doc = r" Generated server implementations."] pub mod control_api_server { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = "Generated trait containing gRPC methods that should be implemented for use with ControlApiServer."] # [async_trait] pub trait ControlApi : Send + Sync + 'static { # [doc = " Creates new Element with a given ID."] # [doc = ""] # [doc = " Not idempotent. Errors if an Element with the same ID already exists."] async fn create (& self , request : tonic :: Request < super :: CreateRequest >) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > ; # [doc = " Removes Element by its ID."] # [doc = " Allows referring multiple Elements on the last two levels."] # [doc = ""] # [doc = " Idempotent. If no Elements with such IDs exist, then succeeds."] async fn delete (& self , request : tonic :: Request < super :: IdRequest >) -> Result < tonic :: Response < super :: Response > , tonic :: Status > ; # [doc = " Returns Element by its ID."] # [doc = " Allows referring multiple Elements."] # [doc = " If no ID specified, returns all Elements declared."] async fn get (& self , request : tonic :: Request < super :: IdRequest >) -> Result < tonic :: Response < super :: GetResponse > , tonic :: Status > ; # [doc = " Applies the given spec to Element by its ID."] # [doc = ""] # [doc = " Idempotent. If no Element with such ID exists, then it will be created,"] # [doc = " otherwise it will be reconfigured. Elements that exist, but are not"] # [doc = " specified in the provided spec will be removed."] async fn apply (& self , request : tonic :: Request < super :: ApplyRequest >) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > ; } # [doc = " Media server's Control API service."] # [derive (Debug)] pub struct ControlApiServer < T : ControlApi > { inner : _Inner < T > , } struct _Inner < T > (Arc < T > , Option < tonic :: Interceptor >) ; impl < T : ControlApi > ControlApiServer < T > { pub fn new (inner : T) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner , None) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner , Some (interceptor . into ())) ; Self { inner } } } impl < T , B > Service < http :: Request < B >> for ControlApiServer < T > where T : ControlApi , B : HttpBody + Send + Sync + 'static , B :: Error : Into < StdError > + Send + 'static , { type Response = http :: Response < tonic :: body :: BoxBody > ; type Error = Never ; type Future = BoxFuture < Self :: Response , Self :: Error > ; fn poll_ready (& mut self , _cx : & mut Context < '_ >) -> Poll < Result < () , Self :: Error >> { Poll :: Ready (Ok (())) } fn call (& mut self , req : http :: Request < B >) -> Self :: Future { let inner = self . inner . clone () ; match req . uri () . path () { "/api.ControlApi/Create" => { # [allow (non_camel_case_types)] struct CreateSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: CreateRequest > for CreateSvc < T > { type Response = super :: CreateResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: CreateRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . create (request) . await } ; Box :: pin (fut) } } let inner = self . inner . clone () ; let fut = async move { let interceptor = inner . 1 . clone () ; let inner = inner . 0 ; let method = CreateSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = if let Some (interceptor) = interceptor { tonic :: server :: Grpc :: with_interceptor (codec , interceptor) } else { tonic :: server :: Grpc :: new (codec) } ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Delete" => { # [allow (non_camel_case_types)] struct DeleteSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: IdRequest > for DeleteSvc < T > { type Response = super :: Response ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: IdRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . delete (request) . await } ; Box :: pin (fut) } } let inner = self . inner . clone () ; let fut = async move { let interceptor = inner . 1 . clone () ; let inner = inner . 0 ; let method = DeleteSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = if let Some (interceptor) = interceptor { tonic :: server :: Grpc :: with_interceptor (codec , interceptor) } else { tonic :: server :: Grpc :: new (codec) } ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Get" => { # [allow (non_camel_case_types)] struct GetSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: IdRequest > for GetSvc < T > { type Response = super :: GetResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: IdRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . get (request) . await } ; Box :: pin (fut) } } let inner = self . inner . clone () ; let fut = async move { let interceptor = inner . 1 . clone () ; let inner = inner . 0 ; let method = GetSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = if let Some (interceptor) = interceptor { tonic :: server :: Grpc :: with_interceptor (codec , interceptor) } else { tonic :: server :: Grpc :: new (codec) } ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Apply" => { # [allow (non_camel_case_types)] struct ApplySvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: ApplyRequest > for ApplySvc < T > { type Response = super :: CreateResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: ApplyRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . apply (request) . await } ; Box :: pin (fut) } } let inner = self . inner . clone () ; let fut = async move { let interceptor = inner . 1 . clone () ; let inner = inner . 0 ; let method = ApplySvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = if let Some (interceptor) = interceptor { tonic :: server :: Grpc :: with_interceptor (codec , interceptor) } else { tonic :: server :: Grpc :: new (codec) } ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } _ => Box :: pin (async move { Ok (http :: Response :: builder () . status (200) . header ("grpc-status" , "12") . header ("content-type" , "application/grpc") . body (tonic :: body :: BoxBody :: empty ()) . unwrap ()) }) , } } } impl < T : ControlApi > Clone for ControlApiServer < T > { fn clone (& self) -> Self { let inner = self . inner . clone () ; Self { inner } } } impl < T : ControlApi > Clone for _Inner < T > { fn clone (& self) -> Self { Self (self . 0 . clone () , self . 1 . clone ()) } } impl < T : std :: fmt :: Debug > std :: fmt :: Debug for _Inner < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "{:?}" , self . 0) } } impl < T : ControlApi > tonic :: transport :: NamedService for ControlApiServer < T > { const NAME : & 'static str = "api.ControlApi" ; } } \ No newline at end of file +# [doc = r" Generated client implementations."] pub mod control_api_client { # ! [allow (unused_variables , dead_code , missing_docs , clippy :: let_unit_value ,)] use tonic :: codegen :: * ; # [doc = " Media server's Control API service."] # [derive (Debug , Clone)] pub struct ControlApiClient < T > { inner : tonic :: client :: Grpc < T > , } impl ControlApiClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > ControlApiClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + Send + Sync + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as Body > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor < F > (inner : T , interceptor : F) -> ControlApiClient < InterceptedService < T , F >> where F : FnMut (tonic :: Request < () >) -> Result < tonic :: Request < () > , tonic :: Status > , T : tonic :: codegen :: Service < http :: Request < tonic :: body :: BoxBody > , Response = http :: Response << T as tonic :: client :: GrpcService < tonic :: body :: BoxBody >> :: ResponseBody > > , < T as tonic :: codegen :: Service < http :: Request < tonic :: body :: BoxBody >> > :: Error : Into < StdError > + Send + Sync , { ControlApiClient :: new (InterceptedService :: new (inner , interceptor)) } # [doc = r" Compress requests with `gzip`."] # [doc = r""] # [doc = r" This requires the server to support it otherwise it might respond with an"] # [doc = r" error."] pub fn send_gzip (mut self) -> Self { self . inner = self . inner . send_gzip () ; self } # [doc = r" Enable decompressing responses with `gzip`."] pub fn accept_gzip (mut self) -> Self { self . inner = self . inner . accept_gzip () ; self } # [doc = " Creates new Element with a given ID."] # [doc = ""] # [doc = " Not idempotent. Errors if an Element with the same ID already exists."] pub async fn create (& mut self , request : impl tonic :: IntoRequest < super :: CreateRequest > ,) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Create") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Removes Element by its ID."] # [doc = " Allows referring multiple Elements on the last two levels."] # [doc = ""] # [doc = " Idempotent. If no Elements with such IDs exist, then succeeds."] pub async fn delete (& mut self , request : impl tonic :: IntoRequest < super :: IdRequest > ,) -> Result < tonic :: Response < super :: Response > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Delete") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Returns Element by its ID."] # [doc = " Allows referring multiple Elements."] # [doc = " If no ID specified, returns all Elements declared."] pub async fn get (& mut self , request : impl tonic :: IntoRequest < super :: IdRequest > ,) -> Result < tonic :: Response < super :: GetResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Get") ; self . inner . unary (request . into_request () , path , codec) . await } # [doc = " Applies the given spec to Element by its ID."] # [doc = ""] # [doc = " Idempotent. If no Element with such ID exists, then it will be created,"] # [doc = " otherwise it will be reconfigured. Elements that exist, but are not"] # [doc = " specified in the provided spec will be removed."] pub async fn apply (& mut self , request : impl tonic :: IntoRequest < super :: ApplyRequest > ,) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/api.ControlApi/Apply") ; self . inner . unary (request . into_request () , path , codec) . await } } }# [doc = r" Generated server implementations."] pub mod control_api_server { # ! [allow (unused_variables , dead_code , missing_docs , clippy :: let_unit_value ,)] use tonic :: codegen :: * ; # [doc = "Generated trait containing gRPC methods that should be implemented for use with ControlApiServer."] # [async_trait] pub trait ControlApi : Send + Sync + 'static { # [doc = " Creates new Element with a given ID."] # [doc = ""] # [doc = " Not idempotent. Errors if an Element with the same ID already exists."] async fn create (& self , request : tonic :: Request < super :: CreateRequest >) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > ; # [doc = " Removes Element by its ID."] # [doc = " Allows referring multiple Elements on the last two levels."] # [doc = ""] # [doc = " Idempotent. If no Elements with such IDs exist, then succeeds."] async fn delete (& self , request : tonic :: Request < super :: IdRequest >) -> Result < tonic :: Response < super :: Response > , tonic :: Status > ; # [doc = " Returns Element by its ID."] # [doc = " Allows referring multiple Elements."] # [doc = " If no ID specified, returns all Elements declared."] async fn get (& self , request : tonic :: Request < super :: IdRequest >) -> Result < tonic :: Response < super :: GetResponse > , tonic :: Status > ; # [doc = " Applies the given spec to Element by its ID."] # [doc = ""] # [doc = " Idempotent. If no Element with such ID exists, then it will be created,"] # [doc = " otherwise it will be reconfigured. Elements that exist, but are not"] # [doc = " specified in the provided spec will be removed."] async fn apply (& self , request : tonic :: Request < super :: ApplyRequest >) -> Result < tonic :: Response < super :: CreateResponse > , tonic :: Status > ; } # [doc = " Media server's Control API service."] # [derive (Debug)] pub struct ControlApiServer < T : ControlApi > { inner : _Inner < T > , accept_compression_encodings : () , send_compression_encodings : () , } struct _Inner < T > (Arc < T >) ; impl < T : ControlApi > ControlApiServer < T > { pub fn new (inner : T) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner) ; Self { inner , accept_compression_encodings : Default :: default () , send_compression_encodings : Default :: default () , } } pub fn with_interceptor < F > (inner : T , interceptor : F) -> InterceptedService < Self , F > where F : FnMut (tonic :: Request < () >) -> Result < tonic :: Request < () > , tonic :: Status > , { InterceptedService :: new (Self :: new (inner) , interceptor) } } impl < T , B > tonic :: codegen :: Service < http :: Request < B >> for ControlApiServer < T > where T : ControlApi , B : Body + Send + Sync + 'static , B :: Error : Into < StdError > + Send + 'static , { type Response = http :: Response < tonic :: body :: BoxBody > ; type Error = Never ; type Future = BoxFuture < Self :: Response , Self :: Error > ; fn poll_ready (& mut self , _cx : & mut Context < '_ >) -> Poll < Result < () , Self :: Error >> { Poll :: Ready (Ok (())) } fn call (& mut self , req : http :: Request < B >) -> Self :: Future { let inner = self . inner . clone () ; match req . uri () . path () { "/api.ControlApi/Create" => { # [allow (non_camel_case_types)] struct CreateSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: CreateRequest > for CreateSvc < T > { type Response = super :: CreateResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: CreateRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . create (request) . await } ; Box :: pin (fut) } } let accept_compression_encodings = self . accept_compression_encodings ; let send_compression_encodings = self . send_compression_encodings ; let inner = self . inner . clone () ; let fut = async move { let inner = inner . 0 ; let method = CreateSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = tonic :: server :: Grpc :: new (codec) . apply_compression_config (accept_compression_encodings , send_compression_encodings) ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Delete" => { # [allow (non_camel_case_types)] struct DeleteSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: IdRequest > for DeleteSvc < T > { type Response = super :: Response ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: IdRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . delete (request) . await } ; Box :: pin (fut) } } let accept_compression_encodings = self . accept_compression_encodings ; let send_compression_encodings = self . send_compression_encodings ; let inner = self . inner . clone () ; let fut = async move { let inner = inner . 0 ; let method = DeleteSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = tonic :: server :: Grpc :: new (codec) . apply_compression_config (accept_compression_encodings , send_compression_encodings) ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Get" => { # [allow (non_camel_case_types)] struct GetSvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: IdRequest > for GetSvc < T > { type Response = super :: GetResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: IdRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . get (request) . await } ; Box :: pin (fut) } } let accept_compression_encodings = self . accept_compression_encodings ; let send_compression_encodings = self . send_compression_encodings ; let inner = self . inner . clone () ; let fut = async move { let inner = inner . 0 ; let method = GetSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = tonic :: server :: Grpc :: new (codec) . apply_compression_config (accept_compression_encodings , send_compression_encodings) ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } "/api.ControlApi/Apply" => { # [allow (non_camel_case_types)] struct ApplySvc < T : ControlApi > (pub Arc < T >) ; impl < T : ControlApi > tonic :: server :: UnaryService < super :: ApplyRequest > for ApplySvc < T > { type Response = super :: CreateResponse ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: ApplyRequest >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . apply (request) . await } ; Box :: pin (fut) } } let accept_compression_encodings = self . accept_compression_encodings ; let send_compression_encodings = self . send_compression_encodings ; let inner = self . inner . clone () ; let fut = async move { let inner = inner . 0 ; let method = ApplySvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = tonic :: server :: Grpc :: new (codec) . apply_compression_config (accept_compression_encodings , send_compression_encodings) ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } _ => Box :: pin (async move { Ok (http :: Response :: builder () . status (200) . header ("grpc-status" , "12") . header ("content-type" , "application/grpc") . body (empty_body ()) . unwrap ()) }) , } } } impl < T : ControlApi > Clone for ControlApiServer < T > { fn clone (& self) -> Self { let inner = self . inner . clone () ; Self { inner , accept_compression_encodings : self . accept_compression_encodings , send_compression_encodings : self . send_compression_encodings , } } } impl < T : ControlApi > Clone for _Inner < T > { fn clone (& self) -> Self { Self (self . 0 . clone ()) } } impl < T : std :: fmt :: Debug > std :: fmt :: Debug for _Inner < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "{:?}" , self . 0) } } impl < T : ControlApi > tonic :: transport :: NamedService for ControlApiServer < T > { const NAME : & 'static str = "api.ControlApi" ; } } \ No newline at end of file diff --git a/proto/control-api/src/grpc/callback.rs b/proto/control-api/src/grpc/callback.rs index cd1ac0c99..01a0eb319 100644 --- a/proto/control-api/src/grpc/callback.rs +++ b/proto/control-api/src/grpc/callback.rs @@ -55,4 +55,4 @@ pub mod on_leave { ServerShutdown = 3, } } -# [doc = r" Generated client implementations."] pub mod callback_client { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = " Service for receiving callbacks from Medea media server."] pub struct CallbackClient < T > { inner : tonic :: client :: Grpc < T > , } impl CallbackClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > CallbackClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + HttpBody + Send + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as HttpBody > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = tonic :: client :: Grpc :: with_interceptor (inner , interceptor) ; Self { inner } } # [doc = "/ Fires when a certain callback event happens on Medea media server."] pub async fn on_event (& mut self , request : impl tonic :: IntoRequest < super :: Request > ,) -> Result < tonic :: Response < super :: Response > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/callback.Callback/OnEvent") ; self . inner . unary (request . into_request () , path , codec) . await } } impl < T : Clone > Clone for CallbackClient < T > { fn clone (& self) -> Self { Self { inner : self . inner . clone () , } } } impl < T > std :: fmt :: Debug for CallbackClient < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "CallbackClient {{ ... }}") } } }# [doc = r" Generated server implementations."] pub mod callback_server { # ! [allow (unused_variables , dead_code , missing_docs)] use tonic :: codegen :: * ; # [doc = "Generated trait containing gRPC methods that should be implemented for use with CallbackServer."] # [async_trait] pub trait Callback : Send + Sync + 'static { # [doc = "/ Fires when a certain callback event happens on Medea media server."] async fn on_event (& self , request : tonic :: Request < super :: Request >) -> Result < tonic :: Response < super :: Response > , tonic :: Status > ; } # [doc = " Service for receiving callbacks from Medea media server."] # [derive (Debug)] pub struct CallbackServer < T : Callback > { inner : _Inner < T > , } struct _Inner < T > (Arc < T > , Option < tonic :: Interceptor >) ; impl < T : Callback > CallbackServer < T > { pub fn new (inner : T) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner , None) ; Self { inner } } pub fn with_interceptor (inner : T , interceptor : impl Into < tonic :: Interceptor >) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner , Some (interceptor . into ())) ; Self { inner } } } impl < T , B > Service < http :: Request < B >> for CallbackServer < T > where T : Callback , B : HttpBody + Send + Sync + 'static , B :: Error : Into < StdError > + Send + 'static , { type Response = http :: Response < tonic :: body :: BoxBody > ; type Error = Never ; type Future = BoxFuture < Self :: Response , Self :: Error > ; fn poll_ready (& mut self , _cx : & mut Context < '_ >) -> Poll < Result < () , Self :: Error >> { Poll :: Ready (Ok (())) } fn call (& mut self , req : http :: Request < B >) -> Self :: Future { let inner = self . inner . clone () ; match req . uri () . path () { "/callback.Callback/OnEvent" => { # [allow (non_camel_case_types)] struct OnEventSvc < T : Callback > (pub Arc < T >) ; impl < T : Callback > tonic :: server :: UnaryService < super :: Request > for OnEventSvc < T > { type Response = super :: Response ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: Request >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . on_event (request) . await } ; Box :: pin (fut) } } let inner = self . inner . clone () ; let fut = async move { let interceptor = inner . 1 . clone () ; let inner = inner . 0 ; let method = OnEventSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = if let Some (interceptor) = interceptor { tonic :: server :: Grpc :: with_interceptor (codec , interceptor) } else { tonic :: server :: Grpc :: new (codec) } ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } _ => Box :: pin (async move { Ok (http :: Response :: builder () . status (200) . header ("grpc-status" , "12") . header ("content-type" , "application/grpc") . body (tonic :: body :: BoxBody :: empty ()) . unwrap ()) }) , } } } impl < T : Callback > Clone for CallbackServer < T > { fn clone (& self) -> Self { let inner = self . inner . clone () ; Self { inner } } } impl < T : Callback > Clone for _Inner < T > { fn clone (& self) -> Self { Self (self . 0 . clone () , self . 1 . clone ()) } } impl < T : std :: fmt :: Debug > std :: fmt :: Debug for _Inner < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "{:?}" , self . 0) } } impl < T : Callback > tonic :: transport :: NamedService for CallbackServer < T > { const NAME : & 'static str = "callback.Callback" ; } } \ No newline at end of file +# [doc = r" Generated client implementations."] pub mod callback_client { # ! [allow (unused_variables , dead_code , missing_docs , clippy :: let_unit_value ,)] use tonic :: codegen :: * ; # [doc = " Service for receiving callbacks from Medea media server."] # [derive (Debug , Clone)] pub struct CallbackClient < T > { inner : tonic :: client :: Grpc < T > , } impl CallbackClient < tonic :: transport :: Channel > { # [doc = r" Attempt to create a new client by connecting to a given endpoint."] pub async fn connect < D > (dst : D) -> Result < Self , tonic :: transport :: Error > where D : std :: convert :: TryInto < tonic :: transport :: Endpoint > , D :: Error : Into < StdError > , { let conn = tonic :: transport :: Endpoint :: new (dst) ? . connect () . await ? ; Ok (Self :: new (conn)) } } impl < T > CallbackClient < T > where T : tonic :: client :: GrpcService < tonic :: body :: BoxBody > , T :: ResponseBody : Body + Send + Sync + 'static , T :: Error : Into < StdError > , < T :: ResponseBody as Body > :: Error : Into < StdError > + Send , { pub fn new (inner : T) -> Self { let inner = tonic :: client :: Grpc :: new (inner) ; Self { inner } } pub fn with_interceptor < F > (inner : T , interceptor : F) -> CallbackClient < InterceptedService < T , F >> where F : FnMut (tonic :: Request < () >) -> Result < tonic :: Request < () > , tonic :: Status > , T : tonic :: codegen :: Service < http :: Request < tonic :: body :: BoxBody > , Response = http :: Response << T as tonic :: client :: GrpcService < tonic :: body :: BoxBody >> :: ResponseBody > > , < T as tonic :: codegen :: Service < http :: Request < tonic :: body :: BoxBody >> > :: Error : Into < StdError > + Send + Sync , { CallbackClient :: new (InterceptedService :: new (inner , interceptor)) } # [doc = r" Compress requests with `gzip`."] # [doc = r""] # [doc = r" This requires the server to support it otherwise it might respond with an"] # [doc = r" error."] pub fn send_gzip (mut self) -> Self { self . inner = self . inner . send_gzip () ; self } # [doc = r" Enable decompressing responses with `gzip`."] pub fn accept_gzip (mut self) -> Self { self . inner = self . inner . accept_gzip () ; self } # [doc = "/ Fires when a certain callback event happens on Medea media server."] pub async fn on_event (& mut self , request : impl tonic :: IntoRequest < super :: Request > ,) -> Result < tonic :: Response < super :: Response > , tonic :: Status > { self . inner . ready () . await . map_err (| e | { tonic :: Status :: new (tonic :: Code :: Unknown , format ! ("Service was not ready: {}" , e . into ())) }) ? ; let codec = tonic :: codec :: ProstCodec :: default () ; let path = http :: uri :: PathAndQuery :: from_static ("/callback.Callback/OnEvent") ; self . inner . unary (request . into_request () , path , codec) . await } } }# [doc = r" Generated server implementations."] pub mod callback_server { # ! [allow (unused_variables , dead_code , missing_docs , clippy :: let_unit_value ,)] use tonic :: codegen :: * ; # [doc = "Generated trait containing gRPC methods that should be implemented for use with CallbackServer."] # [async_trait] pub trait Callback : Send + Sync + 'static { # [doc = "/ Fires when a certain callback event happens on Medea media server."] async fn on_event (& self , request : tonic :: Request < super :: Request >) -> Result < tonic :: Response < super :: Response > , tonic :: Status > ; } # [doc = " Service for receiving callbacks from Medea media server."] # [derive (Debug)] pub struct CallbackServer < T : Callback > { inner : _Inner < T > , accept_compression_encodings : () , send_compression_encodings : () , } struct _Inner < T > (Arc < T >) ; impl < T : Callback > CallbackServer < T > { pub fn new (inner : T) -> Self { let inner = Arc :: new (inner) ; let inner = _Inner (inner) ; Self { inner , accept_compression_encodings : Default :: default () , send_compression_encodings : Default :: default () , } } pub fn with_interceptor < F > (inner : T , interceptor : F) -> InterceptedService < Self , F > where F : FnMut (tonic :: Request < () >) -> Result < tonic :: Request < () > , tonic :: Status > , { InterceptedService :: new (Self :: new (inner) , interceptor) } } impl < T , B > tonic :: codegen :: Service < http :: Request < B >> for CallbackServer < T > where T : Callback , B : Body + Send + Sync + 'static , B :: Error : Into < StdError > + Send + 'static , { type Response = http :: Response < tonic :: body :: BoxBody > ; type Error = Never ; type Future = BoxFuture < Self :: Response , Self :: Error > ; fn poll_ready (& mut self , _cx : & mut Context < '_ >) -> Poll < Result < () , Self :: Error >> { Poll :: Ready (Ok (())) } fn call (& mut self , req : http :: Request < B >) -> Self :: Future { let inner = self . inner . clone () ; match req . uri () . path () { "/callback.Callback/OnEvent" => { # [allow (non_camel_case_types)] struct OnEventSvc < T : Callback > (pub Arc < T >) ; impl < T : Callback > tonic :: server :: UnaryService < super :: Request > for OnEventSvc < T > { type Response = super :: Response ; type Future = BoxFuture < tonic :: Response < Self :: Response > , tonic :: Status > ; fn call (& mut self , request : tonic :: Request < super :: Request >) -> Self :: Future { let inner = self . 0 . clone () ; let fut = async move { (* inner) . on_event (request) . await } ; Box :: pin (fut) } } let accept_compression_encodings = self . accept_compression_encodings ; let send_compression_encodings = self . send_compression_encodings ; let inner = self . inner . clone () ; let fut = async move { let inner = inner . 0 ; let method = OnEventSvc (inner) ; let codec = tonic :: codec :: ProstCodec :: default () ; let mut grpc = tonic :: server :: Grpc :: new (codec) . apply_compression_config (accept_compression_encodings , send_compression_encodings) ; let res = grpc . unary (method , req) . await ; Ok (res) } ; Box :: pin (fut) } _ => Box :: pin (async move { Ok (http :: Response :: builder () . status (200) . header ("grpc-status" , "12") . header ("content-type" , "application/grpc") . body (empty_body ()) . unwrap ()) }) , } } } impl < T : Callback > Clone for CallbackServer < T > { fn clone (& self) -> Self { let inner = self . inner . clone () ; Self { inner , accept_compression_encodings : self . accept_compression_encodings , send_compression_encodings : self . send_compression_encodings , } } } impl < T : Callback > Clone for _Inner < T > { fn clone (& self) -> Self { Self (self . 0 . clone ()) } } impl < T : std :: fmt :: Debug > std :: fmt :: Debug for _Inner < T > { fn fmt (& self , f : & mut std :: fmt :: Formatter < '_ >) -> std :: fmt :: Result { write ! (f , "{:?}" , self . 0) } } impl < T : Callback > tonic :: transport :: NamedService for CallbackServer < T > { const NAME : & 'static str = "callback.Callback" ; } } \ No newline at end of file diff --git a/src/api/client/server.rs b/src/api/client/server.rs index 594b43e82..a62359bc7 100644 --- a/src/api/client/server.rs +++ b/src/api/client/server.rs @@ -24,6 +24,7 @@ use super::MAX_WS_MSG_SIZE; /// Handles all HTTP requests, performs WebSocket handshake (upgrade) and starts /// new [`WsSession`] for WebSocket connection. +#[allow(clippy::unused_async)] async fn ws_index( request: HttpRequest, state: Data, diff --git a/src/api/client/session.rs b/src/api/client/session.rs index 706e607b7..f0b21e443 100644 --- a/src/api/client/session.rs +++ b/src/api/client/session.rs @@ -139,7 +139,7 @@ impl WsSession { text: &str, ) { self.last_activity = Instant::now(); - match serde_json::from_str::(&text) { + match serde_json::from_str::(text) { Ok(ClientMsg::Pong(n)) => { debug!("{}: Received Pong: {}", self, n); } @@ -269,7 +269,7 @@ impl WsSession { CloseReason::InternalError } }; - this.send_left_room(ctx, room_id, reason) + this.send_left_room(ctx, room_id, reason); } }) .wait(ctx); @@ -278,7 +278,7 @@ impl WsSession { "{}: Failed to authorize Rpc Session: Room `{}` does not exist", self, room_id ); - self.send_left_room(ctx, room_id, CloseReason::Rejected) + self.send_left_room(ctx, room_id, CloseReason::Rejected); } } @@ -293,14 +293,14 @@ impl WsSession { _: MemberId, reason: ClosedReason, ) { - if let Some((member, room)) = self.sessions.remove(&room_id) { + if let Some((member, room)) = self.sessions.remove(room_id) { actix::spawn(room.connection_closed(member, reason)); } if self.sessions.is_empty() { self.close_in_place( ctx, &CloseDescription::new(CloseReason::Finished), - ) + ); } } @@ -315,7 +315,7 @@ impl WsSession { state: &state::Room, ) { debug!("{}: Received synchronization request: {:?}", self, state); - if let Some((member_id, room)) = self.sessions.get(&room_id) { + if let Some((member_id, room)) = self.sessions.get(room_id) { ctx.wait(room.synchronize(member_id.clone()).into_actor(self)); } } @@ -396,7 +396,7 @@ impl WsSession { self.fragmentation_buffer.extend_from_slice(&*value); let frame = self.fragmentation_buffer.split(); match std::str::from_utf8(frame.as_ref()) { - Ok(text) => self.handle_text(ctx, &text), + Ok(text) => self.handle_text(ctx, text), Err(err) => { error!("{}: Could not parse ws frame: {}", self, err); } @@ -587,7 +587,7 @@ impl RpcConnection for Addr { // RpcConnection is already closed, so it ok } MailboxError::Timeout => { - error!("Failed Close RpcConnection") + error!("Failed Close RpcConnection"); } } } @@ -683,7 +683,7 @@ impl StreamHandler> for WsSession { /// execution. fn finished(&mut self, ctx: &mut Self::Context) { debug!("{}: message stream is finished", self); - ctx.stop() + ctx.stop(); } } diff --git a/src/api/control/mod.rs b/src/api/control/mod.rs index c12498d03..5ebe1ed4e 100644 --- a/src/api/control/mod.rs +++ b/src/api/control/mod.rs @@ -122,7 +122,6 @@ pub enum RootElement { /// This error is used in all [`TryFrom`] impls of Control API. /// /// [`TryFrom`]: std::convert::TryFrom -#[allow(clippy::pub_enum_variant_names)] #[derive(Clone, Debug, Display, Fail)] pub enum TryFromElementError { /// Element is not `Room`. @@ -137,7 +136,6 @@ pub enum TryFromElementError { /// Errors which can happen while loading static [Control API] specs. /// /// [Control API]: https://tinyurl.com/yxsqplq7 -#[allow(clippy::pub_enum_variant_names)] #[derive(Debug, Display, Fail)] pub enum LoadStaticControlSpecsError { /// Error while reading default or provided in config @@ -229,7 +227,7 @@ pub fn load_static_specs_from_dir>( { let entry = entry?; let spec = load_from_yaml_file(entry.path())?; - specs.push(spec) + specs.push(spec); } Ok(specs) } diff --git a/src/media/peer.rs b/src/media/peer.rs index a9cd4737d..4e574cd00 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -1118,9 +1118,9 @@ impl Peer { for (id, track) in tracks { let mid = mids - .remove(&id) + .remove(id) .ok_or_else(|| PeerError::MidsMismatch(track.id()))?; - track.set_mid(mid) + track.set_mid(mid); } Ok(()) @@ -1481,7 +1481,7 @@ impl<'a> PeerChangesScheduler<'a> { }) .collect(); if changes_indexes_to_remove.is_empty() { - self.schedule_change(PeerChange::RemoveTrack(*id)) + self.schedule_change(PeerChange::RemoveTrack(*id)); } else { for remove_index in changes_indexes_to_remove { self.context.peer_changes_queue.remove(remove_index); diff --git a/src/shutdown.rs b/src/shutdown.rs index d60c9bc47..d5ca14a7b 100644 --- a/src/shutdown.rs +++ b/src/shutdown.rs @@ -157,7 +157,7 @@ impl Handler for GracefulShutdown { } else { error!("Graceful shutdown has timed out, stopping system"); } - System::current().stop() + System::current().stop(); } .boxed_local() } diff --git a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs index 4e233d20b..42bbecc47 100644 --- a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs @@ -80,7 +80,7 @@ impl WebRtcPlayEndpointInner { partner_pid: PeerId, ) { self.peer_id = Some(pid); - self.partner_peer_id = Some(partner_pid) + self.partner_peer_id = Some(partner_pid); } fn peer_id(&self) -> Option { @@ -88,7 +88,7 @@ impl WebRtcPlayEndpointInner { } fn reset(&mut self) { - self.peer_id = None + self.peer_id = None; } } @@ -96,7 +96,7 @@ impl Drop for WebRtcPlayEndpointInner { fn drop(&mut self) { if let Some(receiver_publisher) = self.src.safe_upgrade() { if let Some(partner_peer_id) = self.partner_peer_id { - receiver_publisher.remove_peer_ids(&[partner_peer_id]) + receiver_publisher.remove_peer_ids(&[partner_peer_id]); } receiver_publisher.remove_empty_weaks_from_sinks(); } @@ -191,7 +191,7 @@ impl WebRtcPlayEndpoint { /// _Atm this only resets [`PeerId`]._ #[inline] pub fn reset(&self) { - self.0.borrow_mut().reset() + self.0.borrow_mut().reset(); } /// Returns [`Id`] of this [`WebRtcPlayEndpoint`]. diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index 60041268b..913f6fb12 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -67,7 +67,7 @@ impl Drop for WebRtcPublishEndpointInner { .filter_map(WeakWebRtcPlayEndpoint::safe_upgrade) { if let Some(receiver_owner) = receiver.weak_owner().safe_upgrade() { - drop(receiver_owner.remove_sink(&receiver.id())) + drop(receiver_owner.remove_sink(&receiver.id())); } } } @@ -98,7 +98,7 @@ impl WebRtcPublishEndpointInner { } fn reset(&mut self) { - self.peer_ids = HashSet::new() + self.peer_ids = HashSet::new(); } #[allow(clippy::trivially_copy_pass_by_ref)] @@ -108,7 +108,7 @@ impl WebRtcPublishEndpointInner { fn remove_peer_ids(&mut self, peer_ids: &[PeerId]) { for peer_id in peer_ids { - self.remove_peer_id(peer_id) + self.remove_peer_id(peer_id); } } } @@ -148,7 +148,7 @@ impl WebRtcPublishEndpoint { /// Adds [`WebRtcPlayEndpoint`] (sink) to this [`WebRtcPublishEndpoint`]. #[inline] pub fn add_sink(&self, sink: WeakWebRtcPlayEndpoint) { - self.0.borrow_mut().add_sinks(sink) + self.0.borrow_mut().add_sinks(sink); } /// Returns all [`WebRtcPlayEndpoint`]s (sinks) of this @@ -177,7 +177,7 @@ impl WebRtcPublishEndpoint { /// Adds [`PeerId`] of this [`WebRtcPublishEndpoint`]. #[inline] pub fn add_peer_id(&self, peer_id: PeerId) { - self.0.borrow_mut().add_peer_id(peer_id) + self.0.borrow_mut().add_peer_id(peer_id); } /// Returns all [`PeerId`]s of this [`WebRtcPublishEndpoint`]. @@ -192,13 +192,13 @@ impl WebRtcPublishEndpoint { /// _Atm this only resets `peer_ids`._ #[inline] pub fn reset(&self) { - self.0.borrow_mut().reset() + self.0.borrow_mut().reset(); } /// Removes all [`PeerId`]s related to this [`WebRtcPublishEndpoint`]. #[inline] pub fn remove_peer_ids(&self, peer_ids: &[PeerId]) { - self.0.borrow_mut().remove_peer_ids(peer_ids) + self.0.borrow_mut().remove_peer_ids(peer_ids); } /// Returns [`Id`] of this [`WebRtcPublishEndpoint`]. diff --git a/src/signalling/elements/member.rs b/src/signalling/elements/member.rs index a507748b8..f812ae271 100644 --- a/src/signalling/elements/member.rs +++ b/src/signalling/elements/member.rs @@ -53,7 +53,6 @@ pub enum MembersLoadError { EndpointNotFound(String), } -#[allow(clippy::pub_enum_variant_names)] #[derive(Debug, Fail, Display)] pub enum MemberError { #[display(fmt = "Endpoint [id = {}] not found.", _0)] @@ -305,7 +304,7 @@ impl Member { self.sinks() .values() .filter_map(|p| p.peer_id().map(|id| (id, p))) - .filter(|(id, _)| peer_ids.contains(&id)) + .filter(|(id, _)| peer_ids.contains(id)) .for_each(|(_, p)| p.reset()); } @@ -330,7 +329,7 @@ impl Member { &self, credentials: &client_proto::Credential, ) -> bool { - self.0.borrow().credentials.verify(&credentials) + self.0.borrow().credentials.verify(credentials) } /// Returns all srcs of this [`Member`]. diff --git a/src/signalling/participants.rs b/src/signalling/participants.rs index ca3e36bf7..d8f4cf4f8 100644 --- a/src/signalling/participants.rs +++ b/src/signalling/participants.rs @@ -209,7 +209,7 @@ impl ParticipantService { /// Sends the given [`Event`] to the specified remote [`Member`] if its /// [`RpcConnection`] exists. pub fn send_event_to_member(&self, member_id: &MemberId, event: Event) { - if let Some(conn) = self.connections.get(&member_id) { + if let Some(conn) = self.connections.get(member_id) { conn.send_event(self.room_id.clone(), event); } else { debug!( @@ -288,7 +288,7 @@ impl ParticipantService { ctx.notify(RpcConnectionClosed { member_id, reason: ClosedReason::Closed { normal: false }, - }) + }); }), ); } diff --git a/src/signalling/peers/metrics/flowing_detector.rs b/src/signalling/peers/metrics/flowing_detector.rs index ef848e2ee..339b3cba6 100644 --- a/src/signalling/peers/metrics/flowing_detector.rs +++ b/src/signalling/peers/metrics/flowing_detector.rs @@ -142,7 +142,7 @@ impl RtcStatsHandler for TrafficFlowDetector { if let Some(partner_peer_stat) = self.peers.get(&peer.partner_peer_id()) { first_peer_stat.borrow_mut().partner_peer = - Rc::downgrade(&partner_peer_stat); + Rc::downgrade(partner_peer_stat); partner_peer_stat.borrow_mut().partner_peer = Rc::downgrade(&first_peer_stat); } diff --git a/src/signalling/peers/mod.rs b/src/signalling/peers/mod.rs index 6b8f0d4f8..d326a179c 100644 --- a/src/signalling/peers/mod.rs +++ b/src/signalling/peers/mod.rs @@ -163,7 +163,7 @@ impl PeersService { /// [`Room`]: crate::signalling::Room #[inline] pub fn add_peer>(&self, peer: S) { - self.peers.add_peer(peer) + self.peers.add_peer(peer); } /// Applies a function to the [`PeerStateMachine`] reference with provided @@ -239,7 +239,7 @@ impl PeersService { sink_peer.add_endpoint(&sink.clone().into()); src_peer.as_changes_scheduler().add_publisher( - &src, + src, &mut sink_peer, &self.tracks_count, ); @@ -401,7 +401,7 @@ impl PeersService { second_peer_id, )) } else { - let (src_peer_id, sink_peer_id) = self.create_peers(&src, &sink); + let (src_peer_id, sink_peer_id) = self.create_peers(src, sink); self.peer_post_construct(src_peer_id, &src.clone().into()) .await?; @@ -610,7 +610,7 @@ impl PeersService { peer_id: PeerId, ) -> Result<(), RoomError> { self.peers.map_peer_by_id(peer_id, |peer| { - self.peer_metrics_service.borrow_mut().update_peer(&peer); + self.peer_metrics_service.borrow_mut().update_peer(peer); })?; Ok(()) } diff --git a/src/signalling/peers/traffic_watcher.rs b/src/signalling/peers/traffic_watcher.rs index 4381d5f97..159818d6b 100644 --- a/src/signalling/peers/traffic_watcher.rs +++ b/src/signalling/peers/traffic_watcher.rs @@ -176,7 +176,7 @@ impl PeerTrafficWatcher for Addr { } fn unregister_room(&self, room_id: RoomId) { - self.do_send(UnregisterRoom(room_id)) + self.do_send(UnregisterRoom(room_id)); } async fn register_peer( @@ -194,7 +194,7 @@ impl PeerTrafficWatcher for Addr { } fn unregister_peers(&self, room_id: RoomId, peers_ids: Vec) { - self.do_send(UnregisterPeers { room_id, peers_ids }) + self.do_send(UnregisterPeers { room_id, peers_ids }); } fn traffic_flows( @@ -208,7 +208,7 @@ impl PeerTrafficWatcher for Addr { room_id, peer_id, source, - }) + }); } fn traffic_stopped(&self, room_id: RoomId, peer_id: PeerId, at: Instant) { @@ -217,7 +217,7 @@ impl PeerTrafficWatcher for Addr { room_id, peer_id, at, - }) + }); } } diff --git a/src/signalling/room/dynamic_api.rs b/src/signalling/room/dynamic_api.rs index 86910d58b..e90b46e71 100644 --- a/src/signalling/room/dynamic_api.rs +++ b/src/signalling/room/dynamic_api.rs @@ -370,7 +370,7 @@ impl Handler for Room { } } for fid in member_ids { - self.delete_member(&fid.member_id(), ctx); + self.delete_member(fid.member_id(), ctx); } for fid in endpoint_ids { let (_, member_id, endpoint_id) = fid.take_all(); @@ -455,7 +455,7 @@ impl Handler for Room { let mut create_sink_endpoint = Vec::new(); for (id, element) in &msg.0.pipeline { let spec = MemberSpec::try_from(element)?; - if let Ok(member) = self.members.get_member(&id) { + if let Ok(member) = self.members.get_member(id) { for (src_id, _) in member.srcs() { if spec.get_publish_endpoint_by_id(src_id.clone()).is_none() { diff --git a/src/signalling/room/mod.rs b/src/signalling/room/mod.rs index aa2a0c6f2..908a58bcc 100644 --- a/src/signalling/room/mod.rs +++ b/src/signalling/room/mod.rs @@ -204,7 +204,7 @@ impl Room { Event::PeersRemoved { peer_ids: removed_peers_ids, }, - ) + ); } /// Connects interconnected `Endpoint`s between provided [`Member`]s. @@ -231,7 +231,7 @@ impl Room { if src.owner().id() == member2_id { connect_endpoints_tasks.push( self.peers.clone().connect_endpoints(src, sink.clone()), - ) + ); } } @@ -287,7 +287,7 @@ impl Room { "Peers {:?} removed for member [id = {}].", peers_id, member_id ); - if let Ok(member) = self.members.get_member_by_id(&member_id) { + if let Ok(member) = self.members.get_member_by_id(member_id) { member.peers_removed(&peers_id); self.send_peers_removed(member_id, peers_id); } @@ -340,13 +340,13 @@ impl Room { ctx: &mut Context, ) { let removed_peers = - self.peers.remove_peers_related_to_member(&member_id); + self.peers.remove_peers_related_to_member(member_id); for (peer_member_id, peers_ids) in removed_peers { self.member_peers_removed(peers_ids, &peer_member_id); } self.members - .close_member_connection(&member_id, ws_close_reason, ctx); + .close_member_connection(member_id, ws_close_reason, ctx); if let Ok(member) = self.members.get_member_by_id(member_id) { if let (Some(url), Some(reason)) = diff --git a/src/signalling/room/peer_events_handler.rs b/src/signalling/room/peer_events_handler.rs index 66311159e..a9d95d97d 100644 --- a/src/signalling/room/peer_events_handler.rs +++ b/src/signalling/room/peer_events_handler.rs @@ -82,7 +82,7 @@ impl PeerConnectionStateEventsHandler for WeakAddr { /// [`Peer`] with the provided `peer_id` has stopped. fn peer_stopped(&self, peer_id: PeerId, at: DateTime) { if let Some(addr) = self.upgrade() { - addr.do_send(PeerStopped { peer_id, at }) + addr.do_send(PeerStopped { peer_id, at }); } } } diff --git a/src/signalling/room_service.rs b/src/signalling/room_service.rs index 46085c923..8aa274f80 100644 --- a/src/signalling/room_service.rs +++ b/src/signalling/room_service.rs @@ -538,7 +538,7 @@ impl DeleteElements { /// Adds [`StatefulFid`] to request. #[inline] pub fn add_fid(&mut self, fid: StatefulFid) { - self.fids.push(fid) + self.fids.push(fid); } /// Validates request. It must have at least one fid, all fids must share diff --git a/src/turn/coturn/coturn_metrics.rs b/src/turn/coturn/coturn_metrics.rs index 29a6bd9da..d15ceda43 100644 --- a/src/turn/coturn/coturn_metrics.rs +++ b/src/turn/coturn/coturn_metrics.rs @@ -163,7 +163,7 @@ impl StreamHandler for CoturnMetricsService { event.room_id, event.peer_id, FlowMetricSource::Coturn, - ) + ); } } CoturnAllocationEvent::Deleted => { diff --git a/src/turn/coturn/ice_user.rs b/src/turn/coturn/ice_user.rs index 4a23269b0..36aba58b1 100644 --- a/src/turn/coturn/ice_user.rs +++ b/src/turn/coturn/ice_user.rs @@ -81,7 +81,7 @@ impl CoturnIceUser { ) -> Self { Self { address, - user: IceUsername::new(&room_id, peer_id), + user: IceUsername::new(room_id, peer_id), pass, on_drop: Some(on_drop), }