Elixir XDR v0.1.4 XDR.Float View Source

This module manages the Floating-Point type based on the RFC4506 XDR Standard.

Link to this section Summary

Types

t()

XDR.Float structure type specification.

Functions

Decode the Floating-Point in XDR format to a XDR.Float structure.

Decode the Floating-Point in XDR format to a XDR.Float structure. If the binaries are not valid, an exception is raised.

Encode a XDR.Float structure into a XDR format.

Encode a XDR.Float structure into a XDR format. If the float is not valid, an exception is raised.

Create a new XDR.Float structure with the float passed.

Link to this section Types

Specs

t() :: %XDR.Float{float: integer() | float() | binary()}

XDR.Float structure type specification.

Link to this section Functions

Link to this function

decode_xdr(bytes, float \\ nil)

View Source

Specs

decode_xdr(bytes :: binary(), float :: t()) ::
  {:ok, {t(), binary()}} | {:error, :not_binary}

Decode the Floating-Point in XDR format to a XDR.Float structure.

Link to this function

decode_xdr!(bytes, float \\ nil)

View Source

Specs

decode_xdr!(bytes :: binary(), float :: t()) :: {t(), binary()}

Decode the Floating-Point in XDR format to a XDR.Float structure. If the binaries are not valid, an exception is raised.

Specs

encode_xdr(float :: t()) :: {:ok, binary()} | {:error, :not_number}

Encode a XDR.Float structure into a XDR format.

Specs

encode_xdr!(float :: t()) :: binary()

Encode a XDR.Float structure into a XDR format. If the float is not valid, an exception is raised.

Specs

new(float :: float() | integer() | binary()) :: t()

Create a new XDR.Float structure with the float passed.

Link to this macro

valid_float?(value)

View Source (macro)