Commit graph

256 commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
3f61050944 xmpp-parsers: Implement XEP-0388: Extensible SASL Profile 2024-08-06 16:36:11 +02:00
Emmanuel Gil Peyrot
de2ba97f79 xmpp-parsers: Implement XEP-0440: SASL Channel-Binding Type Capability 2024-08-06 16:36:10 +02:00
Emmanuel Gil Peyrot
f16fb6a6ef xmpp-parsers: Convert the remaining bind2 elements to xso 2024-08-06 16:36:10 +02:00
Emmanuel Gil Peyrot
f0f4299b02 xmpp-parsers: Parse the bind feature in its module, with required
This is different from the bind query or the bind response, despite all
three having the same element namespace and name…  Annoying!
2024-08-06 16:14:42 +02:00
xmppftw
8aca413fc3 Collect unknown stream features in StreamFeatures.others 2024-08-05 21:38:29 +02:00
Jonas Schäfer
fda4a9ff29 xso: implement transparent structs 2024-08-05 15:13:39 +00:00
Emmanuel Gil Peyrot
fea915daf1 xmpp-parsers: Make MAM metadata children pub
This had been forgotten when I converted it to xso.
2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
e1da3410ba xmpp-parsers: Convert MAM prefs to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
0d3e73ec74 xmpp-parsers: Convert bind2 to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
f37b7b4dfd xmpp-parsers: Convert bind to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
2df243966f xmpp-parsers: Convert blocking to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
ce0f3bec0e xmpp-parsers: Convert DataForms validation to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
95d08e3c1e xmpp-parsers: Simplify RTT implementation using more xso
Especially exhaustive enums are super useful for this kind of pattern.
2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
f049e3626b xmpp-parsers: Convert OOB to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
79e224a02a xmpp-parsers: Convert bookmarks to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
9e9186ef7b xmpp-parsers: Convert MUC to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
57c2eeadfc xmpp-parsers: Convert Jingle RTP to xso 2024-08-05 15:02:25 +00:00
Emmanuel Gil Peyrot
4e2af36186 xmpp-parsers: Implement FromXmlText and AsXmlText for default types
This allows such default type wrappers to be used in other xso elements.
2024-08-05 15:02:25 +00:00
Jonas Schäfer
0361b5905b xso: implement catch-all for unknown elements 2024-08-05 15:33:57 +02:00
xmppftw
fa99c09585 Indicate which feature flag for each module/type 2024-08-05 11:14:41 +02:00
xmppftw
aa26d98e2a Check attr="" parse to Some("") in Option<String> 2024-08-05 05:49:14 +00:00
Jonas Schäfer
f466b18622 parsers: port version to derive macros
We can *finally* do it!
2024-08-04 16:07:14 +02:00
Jonas Schäfer
c7c180feb6 xso: implement support for defaulting extracts 2024-08-04 16:07:14 +02:00
Emmanuel Gil Peyrot
aa518fd6c1 xso-proc: add support for extracting attributes into collections 2024-08-04 13:38:52 +02:00
Jonas Schäfer
8732ca9a28 xso: add support for extracting into collections 2024-08-03 18:19:31 +02:00
Emmanuel Gil Peyrot
7ab375fad7 xmpp-parsers: Convert ext disco and Jingle ICE-UDP to xso 2024-08-03 15:48:50 +02:00
Jonas Schäfer
df63c2a78f xso: allow omission of namespace and name on extracts
This is a quality-of-life improvement, as it may save lots of typing in
the common case (see the diff in parsers).
2024-08-03 15:25:46 +02:00
Emmanuel Gil Peyrot
48855843d4 xmpp-parsers: Convert some more elements to xso 2024-08-03 13:21:51 +00:00
Jonas Schäfer
1e0bccc504 parsers: port extracts over to derive macros 2024-08-03 15:17:30 +02:00
Jonas Schäfer
2c5f1f096b xso: implement support for extracting data from child elements 2024-08-03 15:17:30 +02:00
Jonas Schäfer
6440209f95 xso: reject duplicate children
This was an oversight. Even though we apparently don't have tests for
this anywhere, it is what the old functional macros do.
2024-08-03 11:58:19 +00:00
Jonas Schäfer
2b346c4e87 parsers: port more things to derive macros 2024-08-03 13:05:37 +02:00
Jonas Schäfer
93ba2797be xso-proc: implement support for collections of children 2024-08-03 12:20:04 +02:00
Jonas Schäfer
5c3ed1435f parsers: delete now-unused generate_element_enum macro 2024-08-03 12:19:42 +02:00
Jonas Schäfer
6afd0ef52f parsers: port enums over to derive macros 2024-08-03 12:19:42 +02:00
Jonas Schäfer
c028c3b91a xso: implement exhaustive enums
These more closely mirror how enums work currently with the macros.
Non-exhaustive enums may be useful though and kind of were the natural
thing to implement.
2024-08-03 12:19:28 +02:00
Jonas Schäfer
2fe3c0cef2 xso-proc: add fancy hack to allow codec = Foo<Bar>
We can do this because we know that `x < y` cannot create a
`TextCodec<T>` for any `T`. This is because `<` is guaranteed to return
a boolean value, and we simply don't implement `TextCodec<T>` on bool.
2024-08-03 12:14:26 +02:00
Jonas Schäfer
271c31c9d4 xso: use values instead of types for text codecs
This allows stateful or configurable codecs without having to express
all configuration in the type name itself. For example, we could have a
Base64 type with configurable Base64 engines without having to duplicate
the Base64 type itself.

(Note that the different engines in the Base64 crate are values, not
types.)
2024-08-03 12:14:26 +02:00
xmppftw
5110d5fa96 Support <stream:features> in parsers 2024-08-02 18:25:32 +00:00
Jonas Schäfer
4845715add xso: implement support for enums 2024-08-01 15:28:22 +02:00
Jonas Schäfer
507a3df652 xso-proc: remove Span information from generated type names
By removing that, the lint won't trigger for identifiers with trailing
underscores (which become then embedded underscores which normally trips
the `non_camel_case_types` lint).
2024-08-01 12:53:20 +00:00
Jonas Schäfer
3089832090 xso-proc: remove stripping of trailing _ from type names
Users can now rename the generated types altogether, which means that we
do not need this anymore to avoid lints.
2024-08-01 12:53:20 +00:00
Jonas Schäfer
c90752aa51 xso: add support for overriding names of generated types
In 1265f4b, we introduced a change which may cause a conflict of type
names when deriving the traits on two different types. While a
workaround existed (use `mod`s to isolate the implementation), that is
ugly.

This commit allows overriding the choice of type names.
2024-08-01 12:53:20 +00:00
Emmanuel Gil Peyrot
d752d8c8fe xmpp-parsers: Convert Tune to xso
The Tune::new() constructor wasn’t pub before that.
2024-07-31 15:38:10 +00:00
Emmanuel Gil Peyrot
c85bde3d2e xmpp-parsers: Convert MetadataResponse to xso 2024-07-31 15:38:10 +00:00
Jonas Schäfer
819a869ffb parsers: replace some more generate_element! calls with derive macros 2024-07-27 09:39:13 +02:00
Jonas Schäfer
cd9f2033f3 xso: add support for boxed children
This allows building recursive tree structures.
2024-07-27 08:24:25 +02:00
Jonas Schäfer
01336802b4 xso-proc: add support for optional children 2024-07-27 08:24:25 +02:00
Jonas Schäfer
5d284bbd3a parsers: port some elements with children to derive macros 2024-07-26 22:31:42 +02:00
Jonas Schäfer
5bd36eccfc xso-proc: add support for child elements 2024-07-26 22:31:42 +02:00