Port everything over to AsXml

This commit is contained in:
Jonas Schäfer 2024-07-09 17:01:42 +02:00
commit ccf38cdf9b
64 changed files with 848 additions and 371 deletions

View file

@ -4,7 +4,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use xso::{FromXml, IntoXml};
use xso::{AsXml, FromXml};
use crate::date::DateTime;
use crate::ns;
@ -14,7 +14,7 @@ generate_elem_id!(
Mechanism, "mechanism", FAST
);
// TODO: Replace this with a proper bool once we can derive FromXml and IntoXml on FastQuery.
// TODO: Replace this with a proper bool once we can derive FromXml and AsXml on FastQuery.
generate_attribute!(
/// Whether TLS zero-roundtrip is possible.
Tls0Rtt, "tls-0rtt", bool
@ -34,7 +34,7 @@ children: [
);
/// This is the `<fast/>` element the client MUST include within its SASL2 authentication request.
#[derive(FromXml, IntoXml, Debug, Clone, PartialEq)]
#[derive(FromXml, AsXml, Debug, Clone, PartialEq)]
#[xml(namespace = ns::FAST, name = "fast")]
pub struct FastResponse {
/// Servers MUST reject any authentication requests received via TLS 0-RTT payloads that do not
@ -51,7 +51,7 @@ pub struct FastResponse {
}
/// This is the `<request-token/>` element sent by the client in the SASL2 authenticate step.
#[derive(FromXml, IntoXml, Debug, Clone, PartialEq)]
#[derive(FromXml, AsXml, Debug, Clone, PartialEq)]
#[xml(namespace = ns::FAST, name = "request-token")]
pub struct RequestToken {
/// This element MUST contain a 'mechanism' attribute, the value of which MUST be one of the
@ -62,7 +62,7 @@ pub struct RequestToken {
/// This is the `<token/>` element sent by the server on successful SASL2 authentication containing
/// a `<request-token/>` element.
#[derive(FromXml, IntoXml, Debug, Clone, PartialEq)]
#[derive(FromXml, AsXml, Debug, Clone, PartialEq)]
#[xml(namespace = ns::FAST, name = "token")]
pub struct Token {
/// The secret token to be used for subsequent authentications, as generated by the server.