xdr v0.1.1 XDR.Type.FixedOpaque View Source

RFC 4506, Section 4.9 - Fixed-length Opaque data

Link to this section Summary

Types

t()

A binary of any length

Functions

Decodes an fixed opaque xdr binary by truncating it to the desired length

Encodes a fixed opaque binary by appending any necessary padding

Determines if a value is a binary of a valid length

Link to this section Types

Link to this type decode_error() View Source
decode_error() :: {:error, :invalid | :out_of_bounds}
Link to this type len() View Source
len() :: non_neg_integer()

A binary of any length

Link to this section Functions

Link to this function decode(xdr, len) View Source
decode(xdr :: xdr(), len :: len()) ::
  {:ok, {opaque :: t(), rest :: XDR.Type.Base.xdr()}} |
  decode_error()

Decodes an fixed opaque xdr binary by truncating it to the desired length

Link to this function encode(opaque, len) View Source
encode(opaque :: t(), len :: len()) ::
  {:ok, xdr :: xdr()} |
  {:error, :invalid}

Encodes a fixed opaque binary by appending any necessary padding

Link to this function valid?(opaque, len) View Source
valid?(opaque :: t(), len :: len()) :: boolean()

Determines if a value is a binary of a valid length