-module(postgleam@codec@xml). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/postgleam/codec/xml.gleam"). -export([encode/1, decode/1, matcher/0]). -file("src/postgleam/codec/xml.gleam", 31). -spec encode(postgleam@value:value()) -> {ok, bitstring()} | {error, binary()}. encode(Val) -> case Val of {xml, S} -> {ok, gleam_stdlib:identity(S)}; _ -> {error, <<"xml codec: expected Xml value"/utf8>>} end. -file("src/postgleam/codec/xml.gleam", 38). -spec decode(bitstring()) -> {ok, postgleam@value:value()} | {error, binary()}. decode(Data) -> case gleam@bit_array:to_string(Data) of {ok, S} -> {ok, {xml, S}}; {error, _} -> {error, <<"xml codec: invalid UTF-8"/utf8>>} end. -file("src/postgleam/codec/xml.gleam", 21). -spec build(integer()) -> postgleam@codec:codec(). build(Type_oid) -> {codec, <<"xml"/utf8>>, Type_oid, binary, fun encode/1, fun decode/1}. -file("src/postgleam/codec/xml.gleam", 11). -spec matcher() -> postgleam@codec:codec_matcher(). matcher() -> {codec_matcher, <<"xml"/utf8>>, [142], none, binary, fun build/1}.