Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/happy-eyeballs/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 953 B image not shown  

Quelle  id.rs

  Sprache: Rust
 

/// Unique identifier for DNS queries and connection attempts.
///
/// Used to correlate requests (Output events) with their responses (Input events).
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Id(u64);

impl From<u64> for Id {
    fn from(value: u64) -> Self {
        Id(value)
    }
}

impl From<Id> for u64 {
    fn from(id: Id) -> u64 {
        id.0
    }
}

/// Generator for unique IDs.
///
/// Uses a simple incrementing counter. Internal to the crate.
pub(cratestruct IdGenerator {
    next: u64,
}

impl IdGenerator {
    /// Creates a new ID generator starting from 0.
    pub(cratefn new() -> Self {
        Self { next: 0 }
    }

    /// Generates the next unique ID.
    ///
    /// Uses wrapping arithmetic to handle overflow (though u64 overflow is extremely unlikely).
    pub(cratefn next_id(&mut self) -> Id {
        let id = self.next;
        self.next = self.next.wrapping_add(1);
        Id(id)
    }
}

Messung V0.5 in Prozent
C=89 H=98 G=93

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© 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.