eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
455 stars 22 forks source link

Implement display for port factory for all messaging patterns #18

Open elfenpiff opened 6 months ago

elfenpiff commented 6 months ago

(Code) Example Of Cumbersome API

If one would like to print a state overview of a service it would be nice if the port_factory::{event|publish_subscribe|...} would have implemented Display to show the overview from the example.

elfenpiff commented 6 months ago

@hydroid7 I assigned you the issue (so that you have dibs on the issue ;) ) but before you start working on this I suggest waiting until latest 4th December, until elkodon is moved into eclipse-iceoryx/iceoryx-ng and is also renamed to iceoryx-ng. Otherwise, you may encounter a lot of merge conflicts.

Also we could not merge your work before elkodon is part of eclipse-iceoryx due to the licensing issue. At the moment, your work would be published under the GPL 3.0 but this is only a temporary construct and then we need your explicit agreement to re-license your code under a different license.

Still, I am totally happy that you are on board here, so lets focus on the more interesting technical details. The idea came from the example in these two files:

So it would be nice if these two port factories would implement Display and the nice overview that the example is showing would be just a single line of code like:

let event_name = ServiceName::new(b"MyEventName")?;
let event = zero_copy::Service::new(&event_name)
     .event()
     .open_or_create()?;

// this line instead of all the lines from the example
println!("{}", event);
elfenpiff commented 6 months ago

@hydroid7 The day has come and iceoryx2 (codename elkodon, see this here: https://github.com/elkodon/elkodon) will be pushed up here in the next hours.

As promised, you can take over this issue if you like.

Sorry, for the delay but Covid was again flying around.