Saxy.Partial.parse

You're seeing just the function parse, go back to Saxy.Partial module for more information.

Specs

parse(
  partial :: t(),
  data :: binary()
) ::
  {:cont, partial :: t()}
  | {:halt, state :: term()}
  | {:halt, state :: term(), rest :: binary()}
  | {:error, exception :: Saxy.ParseError.t()}

Continue parsing next chunk of the document with a partial.

This function can return in 3 ways:

  • {:cont, partial} - The parsing process has not been terminated.
  • {:halt, user_state} - The parsing process has been terminated, usually because of parser stopping.
  • {:halt, user_state, rest} - The parsing process has been terminated, usually because of parser halting.
  • {:error, exception} - The parsing process has erred.
Link to this function

parse(partial, data, user_state)

View Source

Specs

parse(
  partial :: t(),
  data :: binary(),
  user_state :: term()
) ::
  {:cont, partial :: t()}
  | {:halt, state :: term()}
  | {:halt, state :: term(), rest :: binary()}
  | {:error, exception :: Saxy.ParseError.t()}

Same as partial/2, but continue previous parsing with a new, provided state as the third argument instead of the previous accumulated state.

i.e. Saxy.Partial.parse(partial, binary, new_state) # coninue previous partial with a new state

This function can return in 3 ways:

  • {:cont, partial} - The parsing process has not been terminated.
  • {:halt, user_state} - The parsing process has been terminated, usually because of parser stopping.
  • {:halt, user_state, rest} - The parsing process has been terminated, usually because of parser halting.
  • {:error, exception} - The parsing process has erred.