Skip to content
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

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

RyanGibb
Copy link
Contributor

Copy link
Collaborator

@patricoferris patricoferris left a 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 ^^

lib_eio/net.mli Outdated Show resolved Hide resolved
lib_eio/net.mli Outdated Show resolved Hide resolved
Copy link
Collaborator

@talex5 talex5 left a 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. *)

@RyanGibb RyanGibb force-pushed the mirage-ipaddr-conversion-docs branch from 93cccb8 to 1d0b005 Compare April 19, 2023 16:24
Co-authored-by: Patrick Ferris <[email protected]>
Co-authored-by: Thomas Leonard <[email protected]>
@RyanGibb RyanGibb force-pushed the mirage-ipaddr-conversion-docs branch from 1d0b005 to 14e0bde Compare April 19, 2023 16:28
@RyanGibb
Copy link
Contributor Author

Thanks for the suggestion @talex5, I've applied it now

@talex5 talex5 merged commit b5d56f7 into ocaml-multicore:main Apr 20, 2023
@talex5
Copy link
Collaborator

talex5 commented Apr 20, 2023

Thanks!

@RyanGibb RyanGibb deleted the mirage-ipaddr-conversion-docs branch April 20, 2023 17:08
@talex5 talex5 added this to the 0.10 milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants