View Source jid (jid v2.0.0)
Link to this section Summary
Functions
Returns true if
are_equal(to_bare(A), to_bare(B))
Compares jid structures according to the RFC, i.e., only after normalisation
Equivalent to jid:to_bare(jid:from_binary(BinaryJid)).
Parses a binary and returns a jid record or an error
Parses a binary and returns a jid record or an error, but without normalisation of the parts
Returns true if the input is a valid user part
Equivalent to make(User, Server, Resource).
Takes the user, server, and resource parts, and returns a jid record or an error.
Takes the user and server parts, and returns a jid record with an empty resource, or an error.
Equivalent to make_noprep(User, Server, Resource).
Creates a jid record without validating the input. Useful when input is already trusted.
Prepares the server part of a jid
Prepares the user part of a jid
Replaces the resource part of a jid with a new resource
Replaces the resource part of a jid with a new resource, but without normalisation
Prepares the resource part of a jid
Lowercases a string using the stringprep algorithm
Takes a jid and returns the same jid without its resourcepart
Takes a representation of a jid, and outputs such jid as a literal binary
Returns a jid that contains only prepared strings
Takes a jid and returns a prepared bare jid
Link to this section Types
-type jid() :: #jid{}.
-type literal_jid() :: binary().
-type lresource() :: binary().
-type lserver() :: binary().
-type luser() :: binary().
-type resource() :: binary().
-type server() :: binary().
-type user() :: binary().
Link to this section Functions
are_equal(to_bare(A), to_bare(B))
-spec binary_to_bare(binary()) -> jid() | error.
Equivalent to jid:to_bare(jid:from_binary(BinaryJid)).
-spec from_binary(binary()) -> jid() | error.
-spec from_binary_noprep(binary()) -> jid() | error.
-spec is_nodename(<<>> | binary()) -> boolean().
-spec make(simple_jid()) -> jid() | error.
Equivalent to make(User, Server, Resource).
-spec make_noprep(simple_jid()) -> jid().
Equivalent to make_noprep(User, Server, Resource).
-spec str_tolower(iodata()) -> binary() | error.
-spec to_bare(simple_jid()) -> simple_jid(); (jid()) -> jid(); (error) -> error.
-spec to_bare_binary(simple_jid() | simple_bare_jid() | jid() | literal_jid()) -> binary() | error.
-spec to_binary(simple_jid() | simple_bare_jid() | jid() | literal_jid()) -> binary().
-spec to_lower(simple_jid() | jid()) -> error | simple_jid().
-spec to_lus(jid() | ljid()) -> simple_bare_jid(); (error) -> error.