ratresume 0.1.0

A Rust library for reporting program-resume commands with OSC 7577
Documentation
use std::{io, time::SystemTimeError};

/// Errors returned while preparing or writing an OSC 7577 report.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// Writing the escape sequence failed.
    #[error("failed to write OSC 7577 report: {0}")]
    Io(#[from] io::Error),
    /// The terminal token does not meet the protocol's requirements.
    #[error("OSC7577_TOKEN must contain 22 to 64 letters, digits, '_' or '-'")]
    InvalidToken,
    /// The supplied resume command or working directory is invalid.
    #[error("invalid OSC 7577 report: {0}")]
    InvalidReport(&'static str),
    /// The system clock is before the Unix epoch or cannot be represented.
    #[error("system time cannot be represented as Unix seconds: {0}")]
    InvalidClock(#[source] SystemTimeError),
    /// The current platform has no supported controlling-terminal writer.
    #[error("controlling-terminal output is unsupported on this platform")]
    UnsupportedPlatform,
}