XDR kommit v0.1.0 XDR.Int View Source

This module is in charge of process the integer types based on the RFC4506 XDR Standard

Link to this section Summary

Types

t()

Every integer structure has a datum which represent the integer value which you try to encode

Functions

This function is in charge of decode the XDR value which represents an integer value if the parameters are wrong an error will be raised, it receives an XDR.Int structure which contains the binary value to decode

This function is in charge of decode the XDR value which represents an integer value if the parameters are wrong an error will be raised, it receives an XDR.Int structure which contains the binary value to decode

this function is in charge of encoding a integer value into an XDR if the parameters are wrong an error will be raised it receives an XDR.Int structure

this function is in charge of encoding a integer value into an XDR if the parameters are wrong an error will be raised it receives an XDR.Int structure

this function provides an easy way to create an XDR.Int type

Link to this section Types

Specs

t() :: %XDR.Int{datum: integer()}

Every integer structure has a datum which represent the integer value which you try to encode

Link to this section Functions

Link to this function

decode_xdr(bytes, opts \\ nil)

View Source

Specs

decode_xdr(binary(), any()) :: {:ok, {t(), binary()}}

This function is in charge of decode the XDR value which represents an integer value if the parameters are wrong an error will be raised, it receives an XDR.Int structure which contains the binary value to decode

Returns a tuple with the integer resulted from decode the XDR value and its remaining bits

Link to this function

decode_xdr!(bytes, opts \\ nil)

View Source

Specs

decode_xdr!(binary(), any()) :: {t(), binary()}

This function is in charge of decode the XDR value which represents an integer value if the parameters are wrong an error will be raised, it receives an XDR.Int structure which contains the binary value to decode

Returns the integer resulted from decode the XDR value and its remaining bits

Specs

encode_xdr(t()) :: {:ok, any()}

this function is in charge of encoding a integer value into an XDR if the parameters are wrong an error will be raised it receives an XDR.Int structure

Returns a tuple with the XDR resulted from encoding the integer value

Specs

encode_xdr!(datum :: t()) :: binary()

this function is in charge of encoding a integer value into an XDR if the parameters are wrong an error will be raised it receives an XDR.Int structure

Returns the XDR resulted from encoding the integer value

Specs

new(datum :: integer()) :: t()

this function provides an easy way to create an XDR.Int type

returns a XDR.Int struct with the value received as parameter