#xmpp #jabber #xml

xmpp-parsers

Collection of parsers and serialisers for XMPP extensions

27 releases (breaking)

0.19.2 Dec 17, 2022
0.19.1 Jul 13, 2022
0.19.0 Mar 7, 2022
0.18.1 Jan 13, 2021
0.7.1 Jul 24, 2017

#230 in Network programming

Download history 50/week @ 2022-10-16 80/week @ 2022-10-23 106/week @ 2022-10-30 111/week @ 2022-11-06 71/week @ 2022-11-13 74/week @ 2022-11-20 49/week @ 2022-11-27 84/week @ 2022-12-04 137/week @ 2022-12-11 116/week @ 2022-12-18 74/week @ 2022-12-25 43/week @ 2023-01-01 76/week @ 2023-01-08 56/week @ 2023-01-15 124/week @ 2023-01-22 118/week @ 2023-01-29

379 downloads per month
Used in 10 crates (9 directly)

MPL-2.0 license

765KB
17K 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 manipuled 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

~3.5MB
~49K SLoC