eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.44k stars 151 forks source link

export popular classes from `prelude` #1147

Closed milyin closed 3 months ago

milyin commented 3 months ago

Describe the release item

Current prelude contains traits only and ZError and ZResult. There was a discussion (https://github.com/eclipse-zenoh/zenoh/pull/1007) do we need to export at least the most actively used structures from prelude also. This could be at least structures with same names as corresponding subcrates to allow user to write

use prelude::*;
Session session;

instead of

use prelude::*;
session::Session;

Let's decide, should we extend the prelude this way or not. @Mallets , @wyfo ?

wyfo commented 3 months ago
use prelude::*;
session::Session;

is not possible with the current prelude. Prelude only contains traits (and ZResult/ZError). The decision after #1007 discussion was to not include common english types in prelude (like Session), keep it only for traits. So no,Session should never go into the prelude again (unless you reexport it as ZSession maybe ...) The other part of the decision was to reexport a few types in the root, mostly Error, Result, Session and Config for the moment. So, without import, users are already able to write zenoh::Session, and they can still import it directly, as they do for almost every types of the stdlib/of their dependencies.

TLDR; the decision was already taken after #1007 discussions, I think you can close the issue.

Mallets commented 3 months ago

For the time being I'd say to keep it as it is. We are always in time to add more types in the future. At the moment the coverage of most actively used structures is unclear.

Mallets commented 3 months ago

Closed by https://github.com/eclipse-zenoh/zenoh/pull/1193