ews 0.1.2

Data structures and operations relating to the Exchange Web Services API.
Documentation
/* This Source Code Form is subject to the terms of the Mozilla Public
 * 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 std::io;

use thiserror::Error;

#[cfg(test)]
mod test_utils;

mod types;

pub use types::*;

#[cfg(feature = "interop")]
pub mod interop;

#[derive(Debug, Error)]
pub enum Error {
    #[error("failed to serialize structure as XML: {0}")]
    Serialize(#[from] xml_struct::Error),

    #[error("failed to deserialize structure from XML: {0}")]
    Deserialize(#[from] serde_path_to_error::Error<quick_xml::DeError>),

    #[error("I/O error: {0}")]
    Io(#[from] io::Error),

    #[error("invalid XML document: {0}")]
    InvalidXml(#[from] quick_xml::Error),

    #[error("unexpected response body")]
    UnexpectedResponse(Vec<u8>),

    // The `Fault` is boxed so as to keep the in-memory size of the enum itself
    // relatively low.
    #[error("a fault occurred in the request")]
    RequestFault(Box<soap::Fault>),

    #[error("unknown server version: {0}")]
    UnknownServerVersion(String),
}