#xml-parser #xmpp #xml #xml-element

xmpp-parsers

Collection of parsers and serialisers for XMPP extensions

29 releases (breaking)

0.21.0 Jul 25, 2024
0.20.0 Aug 20, 2023
0.19.2 Dec 17, 2022
0.19.1 Jul 13, 2022
0.7.1 Jul 24, 2017

#2264 in Parser implementations

Download history 41/week @ 2024-08-12 13/week @ 2024-08-19 28/week @ 2024-08-26 10/week @ 2024-09-02 9/week @ 2024-09-09 46/week @ 2024-09-16 118/week @ 2024-09-23 79/week @ 2024-09-30 19/week @ 2024-10-07 56/week @ 2024-10-14 37/week @ 2024-10-21 36/week @ 2024-10-28 46/week @ 2024-11-04 18/week @ 2024-11-11 25/week @ 2024-11-18 27/week @ 2024-11-25

118 downloads per month
Used in 12 crates (10 directly)

MPL-2.0 license

1MB
21K SLoC

xmpp-parsers

What’s this?

A crate which provides parsers and serialisers for most XMPP elements, to avoid having to deal with XML manually. It validates its inputs by default, and aims at providing useful errors when a particular XML element was invalid.

What license is it under?

MPL-2.0 or later, see the LICENSE file.


lib.rs:

A crate parsing common XMPP elements into Rust structures.

Each module implements the TryFrom<Element> trait, which takes a minidom Element and returns a Result whose value is Ok if the element parsed correctly, Err(error::Error) otherwise.

The returned structure can be manipulated as any Rust structure, with each field being public. You can also create the same structure manually, with some having new() and with_*() helper methods to create them.

Once you are happy with your structure, you can serialise it back to an Element, using either From or Into<Element>, which give you what you want to be sending on the wire.

Dependencies

~6.5MB
~122K SLoC