Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit updates the version of Zenoh used to 1.1.0. The bulk of the changes is due to changes in Zenoh's API which can be summarised as follows: - There is no longer an `async` prelude. - There is no longer the need to call `res()` in order to make an asynchronous Zenoh call. - A Zenoh `Session` internally uses an `Arc` so there is no longer the need to explicitly wrap them inside one. - The `Value` structure was removed and, instead, relevant `payload()` method were added. - To access the `Sample` associated with a `Reply` the method `result()` should be called. - We can call `reply_err` to reply to a Query with an error. - To access the bytes representation of a payload, the method `to_bytes()` was introduced. - The `FlumeSubscriber` structure was removed from Zenoh's API. Instead, we use the `Subscriber<FifoChannelHandler<Sample>>`. Internally it still uses `flume` but that dependency is now hidden. --- * Cargo.lock: copied the content of the `Cargo.lock` of Zenoh's 1.1.0 release and ran `cargo build` after. * Cargo.toml: - Updated and froze the version of the Zenoh crates to 1.1.4. - Removed the crates that were no longer needed: - `zenoh-protocol`, - `zenoh-result`, - `zenoh-sync`, - `zenoh-util`. * zenoh-flow-commons/Cargo.toml: replaced the crate `zenoh-protocol` with `zenoh-config` as this is now the crate that exposes the `ZenohId` structure. * zenoh-flow-commons/src/identifiers.rs: - `ZenohId` is now exposed in the `zenoh_config` crate. - `ZenohId::rand()` no longer exists and the implementation of the `Default` trait does the same. * zenoh-flow-daemon/src/daemon/mod.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. * zenoh-flow-daemon/src/daemon/queryables.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call. * zenoh-flow-daemon/src/queries/instances/abort.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. * zenoh-flow-daemon/src/queries/instances/create.rs - There is no longer an `async` prelude. - The `Value` structure was removed and we have to use instead the `payload()` method to attach a payload to a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To access the `Sample` of a `Reply` we now have to call the `result()` method. * zenoh-flow-daemon/src/queries/instances/delete.rs: - There is no longer an `async` prelude. - The `Value` structure was removed and we have to use instead the `payload()` method to attach a payload to a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. * zenoh-flow-daemon/src/queries/instances/mod.rs: - There is no longer an `async` prelude. - The `Query` structure is now under the `zenoh::query` module. - The `reply()` method now takes two parameters: a key expression and a payload. - We can now reply an error using the `reply_err()` method. * zenoh-flow-daemon/src/queries/instances/start.rs: - There is no longer an `async` prelude. - The `Query` structure is now under the `zenoh::query` module. - The `Session` structure is exposed in the root of the `zenoh` crate. - We can now reply an error using the `reply_err()` method. - The `reply()` method now takes two parameters: a key expression and a payload. - The `Value` structure was removed and we have to use instead the `payload()` method to attach a payload to a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. * zenoh-flow-daemon/src/queries/mod.rs: - There is no longer an `async` prelude. - The `Query` structure is now under the `zenoh::query` module. - The check of the encoding was removed as it was superfluous, not providing much added benefits. - The `Value` structure was removed and we have to use instead the `payload()` method to access the payload of a query. - To access the bytes representation of a payload we can now call the `to_bytes()` method. * zenoh-flow-daemon/src/queries/runtime.rs: - There is no longer an `async` prelude. - The `Query` structure is now under the `zenoh::query` module. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - The `reply()` method now takes two parameters: a key expression and a payload. - We can now reply an error using the `reply_err()` method. * zenoh-flow-runtime/src/lib.rs: - The `client`, `empty` and `peer` function no longer exists. - There is no longer an `async` prelude. - The `open` method, `Config` and `Session` structures were moved at the root of the `zenoh` crate. * zenoh-flow-runtime/src/runners/builtin/zenoh/sink.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - The `OwnedKeyExpr` structure is now exposed under the `zenoh::key_expr` module. - The `Publisher` structure is now exposed under the `zenoh::pubsub` module. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. * zenoh-flow-runtime/src/runners/builtin/zenoh/source.rs: - There is no longer an `async` prelude. - The `FlumeSubscriber` no longer exists and was instead replaced with the `FifoChannelHandler`. - The `OwnedKeyExpr` structure is now exposed under the `zenoh::key_expr` module. - The `Publisher` structure is now exposed under the `zenoh::pubsub` module. - The `Sample` structure is now exposed under the `zenoh::sample` module. - The `Session` structure is exposed in the root of the `zenoh` crate. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To access the bytes representation of a payload we can now call the `to_bytes()` method. * zenoh-flow-runtime/src/runners/connectors.rs: - There is no longer an `async` prelude. - The `FlumeSubscriber` no longer exists and was instead replaced with the `FifoChannelHandler`. - The `OwnedKeyExpr` structure is now exposed under the `zenoh::key_expr` module. - The `Publisher` structure is now exposed under the `zenoh::pubsub` module. - The `Sample` structure is now exposed under the `zenoh::sample` module. - The `Session` structure is exposed in the root of the `zenoh` crate. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To "read" the bytes representation of a payload we can now call the `reader()` method. * zenoh-flow-runtime/src/runtime/builder.rs: - The `Session` structure is exposed in the root of the `zenoh` crate. - There is no longer an `async` prelude. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - The `zenoh::config::peer()` function no longer exists and the implementation of the `Default` trait now yields the same result. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res_async()`. * zenoh-flow-runtime/src/runtime/mod.rs: - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. - Due to the previous change, the method `session()` now returns a reference that a caller can `clone()` — yielding the same result. * zenoh-plugin-zenoh-flow/Cargo.toml: removed the no longer needed crates `zenoh-result` and `zenoh-util`. * zenoh-plugin-zenoh-flow/src/lib.rs: - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. That rendes the import to `std::sync::Arc` unneeded. - There is no longer an `async` prelude. - The `zenoh_result::zerror` macro was moved inside the `zenoh::internal` module. - The `Runtime` and `RunningPlugin` were, respectively, moved inside the modules `zenoh::internal::runtime` and `zenoh::internal::plugins`. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - The signature of the method `adminspace_getter` of the `RunningPluginTrait` changed to accept a `KeyExpr` instead of a `Selector`. - The `Result` structure was moved in the root of the `zenoh` crate. - The `Response` structure was moved in the `zenoh::internal::plugins` module. * zfctl/Cargo.toml: removed the unneeded crate `zenoh-util`. * zfctl/src/daemon_command.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - The `Config` structure is exposed in the root of the `zenoh` crate. - The `zenoh::config::peer()` function no longer exists and the implementation of the `Default` trait now yields the same result. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res_async()`. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. * zfctl/src/instance_command.rs: - There is no longer an `async` prelude. - The enumeration `ConsolidationMode` is now exposed in the `zenoh::query` module. - The `Session` structure is exposed in the root of the `zenoh` crate. - The `Value` structure was removed and we have to use instead the `payload()` method to set the payload of a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To access the `Sample` of a `Reply` we now have to call the `result()` method. - To access the bytes representation of a payload we can now call the `to_bytes()` method. - To access the `replier_id` we now have to call the corresponding getter method. * zfctl/src/main.rs: - There is no longer an `async` prelude. - The `Config` structure is exposed in the root of the `zenoh` crate. - The `zenoh::config::peer()` function no longer exists and the implementation of the `Default` trait now yields the same result. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. * zfctl/src/run_local.rs: - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res_async()`. - A `Session` internally uses an `Arc`, meaning that we no longer need to wrap it inside one. * zfctl/src/runtime_command.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - The `Value` structure was removed and we have to use instead the `payload()` method to attach a payload to a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To access the `Sample` of a `Reply` we now have to call the `result()` method. - To access the bytes representation of a payload we can now call the `to_bytes()` method. * zfctl/src/utils.rs: - There is no longer an `async` prelude. - The `Session` structure is exposed in the root of the `zenoh` crate. - The enumeration `ConsolidationMode` is now exposed in the `zenoh::query` module. - The `Value` structure was removed and we have to use instead the `payload()` method to attach a payload to a query. - The `AsyncResolve` trait no longer exists, we can directly `await` a future returned by a Zenoh call — no longer needing to call the method `res()`. - To access the `Sample` of a `Reply` we now have to call the `result()` method. - To access the bytes representation of a payload we can now call the `to_bytes()` method. Signed-off-by: Julien Loudet <[email protected]>
- Loading branch information