View Source hackney_bstr (hackney v1.23.0)

Summary

Types

END: Remove when OTP 17 not officially supported

Functions

Parse a list of case-insensitive alpha characters.

Convert [A-Z] characters to lowercase.
Convert [a-z] characters to uppercase.
Parse a list of digits as a non negative integer.
Parse a list of the given type.
Parse a non-empty list of the given type.
Parse a non empty list of tokens followed with optional parameters.
Parse a list of parameters (a=b;c=d).
Convert a binary string to lowercase.
Parse a token.

Parse a case-insensitive token.

Skip whitespace.
Parse either a token or a quoted string.

Types

cp/0

-opaque cp()

part/0

-type part() :: {Start :: non_neg_integer(), Length :: integer()}.
END: Remove when OTP 17 not officially supported

Functions

alpha(Data, Fun)

-spec alpha(binary(), fun()) -> any().

Parse a list of case-insensitive alpha characters.

Changes all characters to lowercase.

char_to_lower(Ch)

-spec char_to_lower(char()) -> char().
Convert [A-Z] characters to lowercase.

char_to_upper(Ch)

-spec char_to_upper(char()) -> char().
Convert [a-z] characters to uppercase.

digits(Data)

-spec digits(binary()) -> non_neg_integer() | {error, badarg}.
Parse a list of digits as a non negative integer.

digits(Data, Fun)

-spec digits(binary(), fun()) -> any().

digits(Data, Fun, Acc)

-spec digits(binary(), fun(), non_neg_integer()) -> any().

join(L, Separator)

list(Data, Fun)

-spec list(binary(), fun()) -> list() | {error, badarg}.
Parse a list of the given type.

nonempty_list(Data, Fun)

-spec nonempty_list(binary(), fun()) -> [any(), ...] | {error, badarg}.
Parse a non-empty list of the given type.

parameterized_tokens(Data)

-spec parameterized_tokens(binary()) -> any().
Parse a non empty list of tokens followed with optional parameters.

params(Data, Fun)

-spec params(binary(), fun()) -> any().
Parse a list of parameters (a=b;c=d).

quoted_string(_, Fun)

-spec quoted_string(binary(), fun()) -> any().

split(Subject, Pattern, Options)

-spec split(Subject, Pattern, Options) -> Parts
               when
                   Subject :: binary(),
                   Pattern :: binary() | [binary()] | cp(),
                   Options :: [Option],
                   Option :: {scope, part()} | trim | global | trim_all,
                   Parts :: [binary()].

to_binary(V)

to_hex(Bin)

to_lower(L)

-spec to_lower(binary() | atom() | list()) -> binary().
Convert a binary string to lowercase.

to_upper(U)

-spec to_upper(binary() | atom() | list()) -> binary().

token(Data, Fun)

-spec token(binary(), fun()) -> any().
Parse a token.

token_ci(Data, Fun)

-spec token_ci(binary(), fun()) -> any().

Parse a case-insensitive token.

Changes all characters to lowercase.

trim(Data)

-spec trim(binary()) -> binary().

whitespace(Data, Fun)

-spec whitespace(binary(), fun()) -> any().
Skip whitespace.

word(Data, Fun)

-spec word(binary(), fun()) -> any().
Parse either a token or a quoted string.