apt-transport 0.1.0

APT transport abstraction, allowing for custom APT transport implementations in Rust
Documentation
/// Error type for all APT transport operations.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// An I/O error occurred.
    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),

    /// An unexpected end of stream was encountered.
    #[error("message parser: unexpected end of stream")]
    UnexpectedEof,

    /// Too much data was encountered.
    #[error("message parser: too much data encountered")]
    MessageTooMuchData,

    /// A message parsing error occurred.
    #[error("message parser: {0}")]
    MessageParse(String),

    /// A required header was not found.
    ///
    /// When this error is returned by the higher-level abstractions (namely
    /// during URI requests), the APT server will have already been informed
    /// of the failure.
    #[error("required header not found: {0}")]
    HeaderNotFound(String),

    /// An attempt to change the input/output streams after initialization
    /// was made.
    #[error("cannot change input/output streams after initialization")]
    StreamAlreadyInitialized,

    /// APT sent a message type we don't expect nor support.
    #[error("unexpected message type from APT: {0:?}")]
    UnexpectedMessageType(crate::message::MessageType, crate::message::Message),
}