-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document mirage Ipaddr
conversion
#492
Document mirage Ipaddr
conversion
#492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is much cleaner than what we had to do before ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest putting it as a section with of_raw
, e.g.
(** {2 Interoperability}
To convert to or from OCaml Unix addresses, use {!Eio_unix.Ipaddr}.
To interoperate with the {{:https://opam.ocaml.org/packages/ipaddr/} ipaddr} library:
- [Ipaddr.to_octets ipaddr_ip |> Eio.Net.Ipaddr.of_raw]
- [Ipaddr.of_octets_exn (eio_ip :> string)] *)
val of_raw : string -> v4v6
(** [of_raw addr] casts [addr] to an IP address.
@raise Invalid_argument if it is not 4 or 16 bytes long. *)
93cccb8
to
1d0b005
Compare
Co-authored-by: Patrick Ferris <[email protected]> Co-authored-by: Thomas Leonard <[email protected]>
1d0b005
to
14e0bde
Compare
Thanks for the suggestion @talex5, I've applied it now |
Thanks! |
Enabled by mirage/ocaml-ipaddr#117