Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/basic-toml/src/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  error.rs

  Sprache: Rust
 

use std::fmt::{self, Debug, Display};

/// Errors that can occur when serializing or deserializing TOML.
pub struct Error(Box<ErrorInner>);

pub(crateenum ErrorInner {
    Ser(crate::ser::Error),
    De(crate::de::Error),
}

impl Error {
    /// Produces a (line, column) pair of the position of the error if
    /// available.
    ///
    /// All indexes are 0-based.
    pub fn line_col(&self) -> Option<(usize, usize)> {
        match &*self.0 {
            ErrorInner::Ser(_) => None,
            ErrorInner::De(error) => error.line_col(),
        }
    }
}

impl From<crate::ser::Error> for Error {
    fn from(error: crate::ser::Error) -> Self {
        Error(Box::new(ErrorInner::Ser(error)))
    }
}

impl From<crate::de::Error> for Error {
    fn from(error: crate::de::Error) -> Self {
        Error(Box::new(ErrorInner::De(error)))
    }
}

impl Display for Error {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        match &*self.0 {
            ErrorInner::Ser(error) => Display::fmt(error, formatter),
            ErrorInner::De(error) => Display::fmt(error, formatter),
        }
    }
}

impl Debug for Error {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        match &*self.0 {
            ErrorInner::Ser(error) => Debug::fmt(error, formatter),
            ErrorInner::De(error) => Debug::fmt(error, formatter),
        }
    }
}

impl std::error::Error for Error {}

Messung V0.5 in Prozent
C=85 H=100 G=92

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-18) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.