View Source argo_value (argo v1.0.1)

Summary

Types

-type t() :: #argo_value{}.
-type xform_action() :: cont | skip.
-type xform_func(Type, Acc) :: xform_func(Type, Acc, Type, Acc).
-type xform_func(TypeIn, AccIn, TypeOut, AccOut) ::
    fun((TypeIn, AccIn) -> xform_result(TypeOut, AccOut)).
-type xform_result(TypeOut, AccOut) ::
    xform_action() | {xform_action(), AccOut} | {xform_action(), TypeOut, AccOut}.

Functions

-spec array(ArrayValue) -> Value when ArrayValue :: argo_array_value:t(), Value :: t().
-spec block(BlockValue) -> Value when BlockValue :: argo_block_value:t(), Value :: t().
-spec desc(DescValue) -> Value when DescValue :: argo_desc_value:t(), Value :: t().
-spec display(Value) -> ok when Value :: t().
Link to this function

display(Value, IoDevice)

View Source
-spec display(Value, IoDevice) -> ok when Value :: t(), IoDevice :: io:device().
-spec error(ErrorValue) -> Value when ErrorValue :: argo_error_value:t(), Value :: t().
-spec format(Value) -> Output when Value :: t(), Output :: iolist().
Link to this function

format_with_lines(Value)

View Source
-spec format_with_lines(Value) -> unicode:unicode_binary() when Value :: t().
Link to this function

from_json(WireType, JsonValue)

View Source
-spec from_json(WireType, JsonValue) -> Value
             when
                 WireType :: argo_wire_type:t(), JsonValue :: argo_json:json_value(), Value :: t().
Link to this function

from_json(WireType, JsonValue, JsonScalarDecoderModule, JsonScalarDecoderOptions)

View Source
-spec from_json(WireType, JsonValue, JsonScalarDecoderModule, JsonScalarDecoderOptions) -> Value
             when
                 WireType :: argo_wire_type:t(),
                 JsonValue :: argo_json:json_value(),
                 JsonScalarDecoderModule :: module(),
                 JsonScalarDecoderOptions :: argo_json_scalar_decoder:options(),
                 Value :: t().
Link to this function

from_reader(WireType, Reader)

View Source
-spec from_reader(WireType, Reader) -> {Reader, Value}
               when WireType :: argo_wire_type:t(), Reader :: binary(), Value :: t().
-spec is_array(Value) -> boolean() when Value :: t().
-spec is_block(Value) -> boolean() when Value :: t().
-spec is_desc(Value) -> boolean() when Value :: t().
-spec is_error(Value) -> boolean() when Value :: t().
-spec is_labeled(Value) -> boolean() when Value :: t().
-spec is_nullable(Value) -> boolean() when Value :: t().
-spec is_path(Value) -> boolean() when Value :: t().
-spec is_record(Value) -> boolean() when Value :: t().
-spec is_scalar(Value) -> boolean() when Value :: t().
-spec nullable(NullableValue) -> Value when NullableValue :: argo_nullable_value:t(), Value :: t().
-spec path(PathValue) -> Value when PathValue :: argo_path_value:t(), Value :: t().
-spec record(RecordValue) -> Value when RecordValue :: argo_record_value:t(), Value :: t().
-spec scalar(ScalarValue) -> Value when ScalarValue :: argo_scalar_value:t(), Value :: t().
-spec to_json(Value) -> JsonValue when Value :: t(), JsonValue :: argo_json:json_value().
Link to this function

to_json(Value, JsonScalarEncoderModule, JsonScalarEncoderOptions)

View Source
-spec to_json(Value, JsonScalarEncoderModule, JsonScalarEncoderOptions) -> JsonValue
           when
               Value :: t(),
               JsonScalarEncoderModule :: module(),
               JsonScalarEncoderOptions :: argo_json_scalar_encoder:options(),
               JsonValue :: argo_json:json_value().
-spec to_wire_type(Value) -> WireType when Value :: t(), WireType :: argo_wire_type:t().
-spec to_writer(Value) -> Writer when Value :: t(), Writer :: binary().
Link to this function

to_writer(Value, Header)

View Source
-spec to_writer(Value, Header) -> Writer
             when Value :: t(), Header :: argo_header:t(), Writer :: binary().
Link to this function

xform(TypeIn, AccIn, Fun)

View Source
-spec xform(TypeIn, AccIn, Fun) -> {TypeOut, AccOut}
         when
             TypeIn :: dynamic(),
             AccIn :: dynamic(),
             Fun :: xform_func(TypeIn, AccIn, TypeOut, AccOut),
             TypeOut :: dynamic(),
             AccOut :: dynamic().