domain icon indicating copy to clipboard operation
domain copied to clipboard

Difference between domain::base::name::Dname and domain::rdata::dname::Dname?

Open WhyNotHugo opened this issue 2 years ago • 2 comments

I've gotten these types mixed up a few times:

  • https://docs.rs/domain/latest/domain/base/name/struct.Dname.html
  • https://docs.rs/domain/latest/domain/rdata/dname/struct.Dname.html

How exactly do they differ? In which cases in the second one used? It is possible to maybe fold them into a single type? The same-name does lead to a bit of confusion.

WhyNotHugo avatar Aug 23 '23 15:08 WhyNotHugo

Sorry for the late reply. Summer vacation and all that.

The type in the rdata module is for the DNAME record type, which is like a CNAME but delegates the entire tree under the name to a new location not just a single specific name.

The clash between the names is unfortunate, indeed, but I don’t think we can do anything about it at this point. Renaming base::Dname<_> would be quite the hassle now.

partim avatar Sep 18 '23 12:09 partim

The type in the rdata module is for the DNAME record type, which is like a CNAME but delegates the entire tree under the name to a new location not just a single specific name.

Thanks for the explanation; today I learnt something!

Renaming base::Dname<_> would be quite the hassle now.

Definitely non-trivial. Maybe it's a breaking change that can be considered before the 1.0 release? I'm sure that rust_analyzer's rename-type feature can do most of the heavy lifting.

WhyNotHugo avatar Sep 20 '23 17:09 WhyNotHugo