NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
341 stars 57 forks source link

Change ToDname/ToRelativeDname to have try_to_*name and to_*name pairs. #285

Closed partim closed 5 months ago

partim commented 5 months ago

This PR changes the ToDname and ToRelativeDname traits to have a pair of methods for each conversion that either return a result or just a success value depending on whether the octets builder used for the name can fail. This should allow removing quite a few unwraps when e.g. Vec<u8> or Bytes are used.

This is a breaking change.

Fixes #281.