View Source argo_erlang_term_value_decoder (argo v1.1.0)
Summary
Types
-type error_reason() :: argo_term_value_decoder:error_reason().
-type options() :: #{scalar_decoder_module => module(), scalar_decoder_options => argo_erlang_term_scalar_decoder:options()}.
-type result(Ok, Error) :: argo_term_value_decoder:result(Ok, Error).
-type state() :: #argo_erlang_term_value_decoder{scalar_decoder_module :: module(), scalar_decoder_state :: argo_erlang_term_scalar_decoder:state()}.
Functions
-spec decode_array(DecoderState, ArrayWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderState :: state(), ArrayWireTypeHint :: argo_term:array_wire_type_hint(), TermValue :: argo_term:term_value(), Result :: result(ArrayTermValue, ErrorReason), ArrayTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_array_next(DecoderState, Index, ArrayWireTypeHint, ArrayTermValue)
View Source-spec decode_array_next(DecoderState, Index, ArrayWireTypeHint, ArrayTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), ArrayWireTypeHint :: argo_term:array_wire_type_hint(), ArrayTermValue :: argo_term:term_value(), Result :: result({ArrayTermValue, OptionItemTermValue}, ErrorReason), OptionItemTermValue :: argo_types:option(ItemTermValue), ItemTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_array_stop(DecoderState, ArrayTermValue, ArrayValue) -> {DecoderState, Result} when DecoderState :: state(), ArrayTermValue :: argo_term:term_value(), ArrayValue :: argo_array_value:t(), Result :: result(ArrayValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_block(DecoderState, BlockWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderState :: state(), BlockWireTypeHint :: argo_term:block_wire_type_hint(), TermValue :: argo_term:term_value(), Result :: result(BlockTermValue, ErrorReason), BlockTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_block_stop(DecoderState, BlockValue) -> {DecoderState, Result} when DecoderState :: state(), BlockValue :: argo_block_value:t(), Result :: result(DecoderState, ErrorReason), ErrorReason :: error_reason().
-spec decode_desc(DecoderState, TermValue) -> {DecoderState, Result} when DecoderState :: state(), TermValue :: argo_term:term_value(), Result :: result({DescTermValue, DescValueHint}, ErrorReason), DescTermValue :: argo_term:term_value(), DescValueHint :: argo_term:desc_value_hint(), ErrorReason :: error_reason().
-spec decode_desc_list_next(DecoderState, Index, DescListTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), DescListTermValue :: argo_term:term_value(), Result :: result({DescListTermValue, OptionItemTermValue}, ErrorReason), OptionItemTermValue :: argo_types:option(ItemTermValue), ItemTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_desc_list_stop(DecoderState, DescListTermValue, DescValue) -> {DecoderState, Result} when DecoderState :: state(), DescListTermValue :: argo_term:term_value(), DescValue :: argo_desc_value:t(), Result :: result(DescValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_desc_object_next(DecoderState, Index, DescObjectTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), DescObjectTermValue :: argo_term:term_value(), Result :: result({DescObjectTermValue, OptionEntry}, ErrorReason), OptionEntry :: argo_types:option({ObjectKey, ObjectTermValue}), ObjectKey :: unicode:unicode_binary(), ObjectTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_desc_object_stop(DecoderState, DescObjectTermValue, DescValue)
View Source-spec decode_desc_object_stop(DecoderState, DescObjectTermValue, DescValue) -> {DecoderState, Result} when DecoderState :: state(), DescObjectTermValue :: argo_term:term_value(), DescValue :: argo_desc_value:t(), Result :: result(DescValue, ErrorReason), ErrorReason :: error_reason().
Link to this function
decode_desc_scalar(DecoderState, DescValueScalarHint, DescScalarTermValue)
View Source-spec decode_desc_scalar(DecoderState, DescValueScalarHint, DescScalarTermValue) -> {DecoderState, Result} when DecoderState :: state(), DescValueScalarHint :: argo_term:desc_value_scalar_hint(), DescScalarTermValue :: argo_term:term_value(), Result :: result({DescScalarTermValue, DescScalar}, ErrorReason), DescScalar :: argo_desc_value:inner_scalar(), ErrorReason :: error_reason().
Link to this function
decode_desc_scalar_stop(DecoderState, DescScalarTermValue, DescValue)
View Source-spec decode_desc_scalar_stop(DecoderState, DescScalarTermValue, DescValue) -> {DecoderState, Result} when DecoderState :: state(), DescScalarTermValue :: argo_term:term_value(), DescValue :: argo_desc_value:t(), Result :: result(DescValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_error(DecoderState, TermValue) -> {DecoderState, Result} when DecoderState :: state(), TermValue :: argo_term:term_value(), Result :: result(ErrorTermValue, ErrorReason), ErrorTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_error_extensions(DecoderState, ErrorTermValue) -> {DecoderState, Result} when DecoderState :: state(), ErrorTermValue :: argo_term:term_value(), Result :: result({ErrorTermValue, OptionExtensionsTermValue}, ErrorReason), OptionExtensionsTermValue :: argo_types:option(ExtensionsTermValue), ExtensionsTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_error_locations(DecoderState, ErrorTermValue) -> {DecoderState, Result} when DecoderState :: state(), ErrorTermValue :: argo_term:term_value(), Result :: result({ErrorTermValue, OptionLocationsTermValue}, ErrorReason), OptionLocationsTermValue :: argo_types:option(LocationsTermValue), LocationsTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_error_message(DecoderState, ErrorTermValue) -> {DecoderState, Result} when DecoderState :: state(), ErrorTermValue :: argo_term:term_value(), Result :: result({ErrorTermValue, OptionMessageTermValue}, ErrorReason), OptionMessageTermValue :: argo_types:option(MessageTermValue), MessageTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_error_path(DecoderState, ErrorTermValue) -> {DecoderState, Result} when DecoderState :: state(), ErrorTermValue :: argo_term:term_value(), Result :: result({ErrorTermValue, OptionPathTermValue}, ErrorReason), OptionPathTermValue :: argo_types:option(PathTermValue), PathTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_error_stop(DecoderState, ErrorTermValue, ErrorValue) -> {DecoderState, Result} when DecoderState :: state(), ErrorTermValue :: argo_term:term_value(), ErrorValue :: argo_error_value:t(), Result :: result(ErrorValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_extensions(DecoderState, TermValue) -> {DecoderState, Result} when DecoderState :: state(), TermValue :: argo_term:term_value(), Result :: result(ExtensionsTermValue, ErrorReason), ExtensionsTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_extensions_next(DecoderState, Index, ExtensionsTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), ExtensionsTermValue :: argo_term:term_value(), Result :: result({ExtensionsTermValue, OptionEntry}, ErrorReason), OptionEntry :: argo_types:option({ObjectKey, ObjectTermValue}), ObjectKey :: unicode:unicode_binary(), ObjectTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_extensions_stop(DecoderState, ExtensionsTermValue, ExtensionsValue)
View Source-spec decode_extensions_stop(DecoderState, ExtensionsTermValue, ExtensionsValue) -> {DecoderState, Result} when DecoderState :: state(), ExtensionsTermValue :: argo_term:term_value(), ExtensionsValue :: argo_extensions_value:t(), Result :: result(ExtensionsValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_location(DecoderState, LocationTermValue) -> {DecoderState, Result} when DecoderState :: state(), LocationTermValue :: argo_term:term_value(), Result :: result(LocationTermValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_location_column(DecoderState, LocationTermValue) -> {DecoderState, Result} when DecoderState :: state(), LocationTermValue :: argo_term:term_value(), Result :: result({LocationTermValue, OptionColumnTermValue}, ErrorReason), OptionColumnTermValue :: argo_types:option(ColumnTermValue), ColumnTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_location_line(DecoderState, LocationTermValue) -> {DecoderState, Result} when DecoderState :: state(), LocationTermValue :: argo_term:term_value(), Result :: result({LocationTermValue, OptionLineTermValue}, ErrorReason), OptionLineTermValue :: argo_types:option(LineTermValue), LineTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_location_stop(DecoderState, LocationTermValue, LocationValue)
View Source-spec decode_location_stop(DecoderState, LocationTermValue, LocationValue) -> {DecoderState, Result} when DecoderState :: state(), LocationTermValue :: argo_term:term_value(), LocationValue :: argo_location_value:t(), Result :: result(LocationValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_locations(DecoderState, LocationsTermValue) -> {DecoderState, Result} when DecoderState :: state(), LocationsTermValue :: argo_term:term_value(), Result :: result(LocationsTermValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_locations_next(DecoderState, Index, LocationsTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), LocationsTermValue :: argo_term:term_value(), Result :: result({LocationsTermValue, OptionLocationTermValue}, ErrorReason), OptionLocationTermValue :: argo_types:option(LocationTermValue), LocationTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_locations_stop(DecoderState, LocationsTermValue, LocationValueList)
View Source-spec decode_locations_stop(DecoderState, LocationsTermValue, LocationValueList) -> {DecoderState, Result} when DecoderState :: state(), LocationsTermValue :: argo_term:term_value(), LocationValueList :: [LocationValue], LocationValue :: argo_location_value:t(), Result :: result(LocationValueList, ErrorReason), ErrorReason :: error_reason().
-spec decode_nullable(DecoderState, NullableWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderState :: state(), NullableWireTypeHint :: argo_term:nullable_wire_type_hint(), TermValue :: argo_term:term_value(), Result :: result(NullableTermValue, ErrorReason), NullableTermValue :: null | {non_null, NonNullTermValue} | {field_errors, FieldErrorsTermValue}, NonNullTermValue :: argo_term:term_value(), FieldErrorsTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_nullable_field_errors(DecoderState, NullableWireTypeHint, FieldErrorsTermValue)
View Source-spec decode_nullable_field_errors(DecoderState, NullableWireTypeHint, FieldErrorsTermValue) -> {DecoderState, Result} when DecoderState :: state(), NullableWireTypeHint :: argo_term:nullable_wire_type_hint(), FieldErrorsTermValue :: argo_term:term_value(), Result :: result(FieldErrorsTermValue, ErrorReason), ErrorReason :: error_reason().
Link to this function
decode_nullable_field_errors_next(DecoderState, Index, NullableWireTypeHint, FieldErrorsTermValue)
View Source-spec decode_nullable_field_errors_next(DecoderState, Index, NullableWireTypeHint, FieldErrorsTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), NullableWireTypeHint :: argo_term:nullable_wire_type_hint(), FieldErrorsTermValue :: argo_term:term_value(), Result :: result({FieldErrorsTermValue, OptionFieldErrorTermValue}, ErrorReason), OptionFieldErrorTermValue :: argo_types:option(FieldErrorTermValue), FieldErrorTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_nullable_field_errors_stop(DecoderState, FieldErrorsTermValue, FieldErrorsValue)
View Source-spec decode_nullable_field_errors_stop(DecoderState, FieldErrorsTermValue, FieldErrorsValue) -> {DecoderState, Result} when DecoderState :: state(), FieldErrorsTermValue :: argo_term:term_value(), FieldErrorsValue :: [FieldErrorValue], FieldErrorValue :: argo_error_value:t(), Result :: result(FieldErrorsValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_nullable_stop(DecoderState, NullableValue) -> {DecoderState, Result} when DecoderState :: state(), NullableValue :: argo_nullable_value:t(), Result :: result(NullableValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_path(DecoderState, TermValue) -> {DecoderState, Result} when DecoderState :: state(), TermValue :: argo_term:term_value(), Result :: result(PathTermValue, ErrorReason), PathTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_path_next(DecoderState, Index, PathTermValue) -> {DecoderState, Result} when DecoderState :: state(), Index :: argo_types:index(), PathTermValue :: argo_term:term_value(), Result :: result({PathTermValue, OptionSegment}, ErrorReason), OptionSegment :: argo_types:option(FieldName | ListIndex), FieldName :: argo_types:name(), ListIndex :: argo_types:index(), ErrorReason :: error_reason().
-spec decode_path_stop(DecoderState, PathTermValue, PathValue) -> {DecoderState, Result} when DecoderState :: state(), PathTermValue :: argo_term:term_value(), PathValue :: argo_path_value:t(), Result :: result(PathValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_record(DecoderState, RecordWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderState :: state(), RecordWireTypeHint :: argo_term:record_wire_type_hint(), TermValue :: argo_term:term_value(), Result :: result(RecordTermValue, ErrorReason), RecordTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
Link to this function
decode_record_next(DecoderState, Index, FieldWireTypeHint, RecordTermValue)
View Source-spec decode_record_next(DecoderState, Index, FieldWireTypeHint, RecordTermValue) -> {DecoderState, Result} when DecoderState :: state(), FieldWireTypeHint :: argo_term:field_wire_type_hint(), Index :: argo_types:index(), RecordTermValue :: argo_term:term_value(), Result :: result({RecordTermValue, OptionFieldTermValue}, ErrorReason), OptionFieldTermValue :: argo_types:option(FieldTermValue), FieldTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_record_stop(DecoderState, RecordTermValue, RecordValue) -> {DecoderState, Result} when DecoderState :: state(), RecordTermValue :: argo_term:term_value(), RecordValue :: argo_record_value:t(), Result :: result(RecordValue, ErrorReason), ErrorReason :: error_reason().
-spec decode_scalar(DecoderState, ScalarWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderState :: state(), ScalarWireTypeHint :: argo_term:scalar_wire_type_hint(), TermValue :: argo_term:term_value(), Result :: result(Scalar, ErrorReason), Scalar :: boolean() | binary() | DescTermValue | float() | unicode:unicode_binary() | argo_types:i64(), DescTermValue :: argo_term:term_value(), ErrorReason :: error_reason().
-spec decode_scalar_stop(DecoderState, ScalarValue) -> {DecoderState, Result} when DecoderState :: state(), ScalarValue :: argo_scalar_value:t(), Result :: result(ScalarValue, ErrorReason), ErrorReason :: error_reason().