eclipse-uprotocol / up-rust

uProtocol Language Specific Library for Rust
Apache License 2.0
11 stars 9 forks source link

Adding short-form UUri #80

Closed evshary closed 4 months ago

evshary commented 6 months ago

Now the short-form UUri is back in https://github.com/eclipse-uprotocol/up-spec/pull/89, should we add the short-form UUri in up-rust? It might be easier to transform the UUri into MQTT topic or Zenoh key if we have short-form UUri, but still need to sync with other languages to ensure interoperability.

PLeVasseur commented 6 months ago

A good point! We need to add support for Short form for compliance with 1.5.8

PLeVasseur commented 5 months ago

Wanted to highlight this one again -- anybody able to take this one atm?

Going to matter soon for 1.5.8.

Maybe @sophokles73 or @AnotherDaniel can add a "help wanted" tag if nobody is free.

PLeVasseur commented 5 months ago

Maybe good to also add v1.5.8 tag on here @stevenhartley

stevenhartley commented 5 months ago

Maybe good to also add v1.5.8 tag on here @stevenhartley

the tag is in the up-spec project. You guys can add the tags to the other projects if you like.

sophokles73 commented 5 months ago

Before we start implementing this, I'd like to first clarify what kind of UUris we actually want to be able to serialize to short form, in particular in the context of wildcard usage in UUris ...

PLeVasseur commented 5 months ago

A relevant comment over on the up-cpp API redesign I made:

Interesting question 🤔

Over in up-rust, we completely dismantled the idea of having separate serializers and deserializers.

We instead leaned on the Rust trait TryFrom and impled that on the UUri struct to allow going:

  • UUri -> String, String -> UUri (i.e. long form) and
  • UUri -> Vec<u8>, Vec<u8> -> UUri (i.e. micro form)

which, thinking about it now, is a bit of a fumble, since both Long Form and Short Form are Strings, so we'll need to revisit this

sophokles73 commented 4 months ago

This is obsolete with https://github.com/eclipse-uprotocol/up-spec/pull/126 and https://github.com/eclipse-uprotocol/up-spec/pull/121