View Source argo_erlang_term_scalar_decoder behaviour (argo v1.1.0)
Summary
Types
-type error_reason() :: argo_erlang_term_value_decoder:error_reason().
-type options() :: dynamic().
-type result(Ok, Error) :: argo_erlang_term_value_decoder:result(Ok, Error).
-type state() :: dynamic().
Callbacks
Link to this callback
decode_block(DecoderState, BlockWireTypeHint, TermValue)
View Source (optional)-callback 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().
-callback decode_block_stop(DecoderState, BlockValue) -> {DecoderState, Result} when DecoderState :: state(), BlockValue :: argo_block_value:t(), Result :: result(DecoderState, ErrorReason), ErrorReason :: error_reason().
-callback 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().
Link to this callback
decode_desc_list_stop(DecoderState, DescListTermValue, DescValue)
View Source (optional)-callback 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().
Link to this callback
decode_desc_object_stop(DecoderState, DescObjectTermValue, DescValue)
View Source (optional)-callback 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 callback
decode_desc_scalar(DecoderState, DescValueScalarHint, DescScalarTermValue)
View Source (optional)-callback 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 callback
decode_desc_scalar_stop(DecoderState, DescScalarTermValue, DescValue)
View Source (optional)-callback 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().
Link to this callback
decode_scalar(DecoderState, ScalarWireTypeHint, TermValue)
View Source (optional)-callback 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().
-callback decode_scalar_stop(DecoderState, ScalarValue) -> {DecoderState, Result} when DecoderState :: state(), ScalarValue :: argo_scalar_value:t(), Result :: result(ScalarValue, ErrorReason), ErrorReason :: error_reason().
Functions
Link to this function
decode_block(DecoderModule, DecoderState, BlockWireTypeHint, TermValue)
View Source-spec decode_block(DecoderModule, DecoderState, BlockWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderModule :: module(), 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(DecoderModule, DecoderState, BlockValue) -> {DecoderState, Result} when DecoderModule :: module(), DecoderState :: state(), BlockValue :: argo_block_value:t(), Result :: result(DecoderState, ErrorReason), ErrorReason :: error_reason().
-spec decode_desc(DecoderModule, DecoderState, TermValue) -> {DecoderState, Result} when DecoderModule :: module(), 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().
Link to this function
decode_desc_list_stop(DecoderModule, DecoderState, DescListTermValue, DescValue)
View Source-spec decode_desc_list_stop(DecoderModule, DecoderState, DescListTermValue, DescValue) -> {DecoderState, Result} when DecoderModule :: module(), DecoderState :: state(), DescListTermValue :: argo_term:term_value(), DescValue :: argo_desc_value:t(), Result :: result(DescValue, ErrorReason), ErrorReason :: error_reason().
Link to this function
decode_desc_object_stop(DecoderModule, DecoderState, DescObjectTermValue, DescValue)
View Source-spec decode_desc_object_stop(DecoderModule, DecoderState, DescObjectTermValue, DescValue) -> {DecoderState, Result} when DecoderModule :: module(), 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(DecoderModule, DecoderState, DescValueScalarHint, DescScalarTermValue)
View Source-spec decode_desc_scalar(DecoderModule, DecoderState, DescValueScalarHint, DescScalarTermValue) -> {DecoderState, Result} when DecoderModule :: module(), 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(DecoderModule, DecoderState, DescScalarTermValue, DescValue)
View Source-spec decode_desc_scalar_stop(DecoderModule, DecoderState, DescScalarTermValue, DescValue) -> {DecoderState, Result} when DecoderModule :: module(), DecoderState :: state(), DescScalarTermValue :: argo_term:term_value(), DescValue :: argo_desc_value:t(), Result :: result(DescValue, ErrorReason), ErrorReason :: error_reason().
Link to this function
decode_scalar(DecoderModule, DecoderState, ScalarWireTypeHint, TermValue)
View Source-spec decode_scalar(DecoderModule, DecoderState, ScalarWireTypeHint, TermValue) -> {DecoderState, Result} when DecoderModule :: module(), 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(DecoderModule, DecoderState, ScalarValue) -> {DecoderState, Result} when DecoderModule :: module(), DecoderState :: state(), ScalarValue :: argo_scalar_value:t(), Result :: result(ScalarValue, ErrorReason), ErrorReason :: error_reason().