Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/objc2-core-foundation/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  uuid.rs

  Sprache: Rust
 

use crate::CFUUIDBytes;

impl From<[u8; 16]> for CFUUIDBytes {
    #[inline]
    fn from(value: [u8; 16]) -> Self {
        Self {
            byte0: value[0],
            byte1: value[1],
            byte2: value[2],
            byte3: value[3],
            byte4: value[4],
            byte5: value[5],
            byte6: value[6],
            byte7: value[7],
            byte8: value[8],
            byte9: value[9],
            byte10: value[10],
            byte11: value[11],
            byte12: value[12],
            byte13: value[13],
            byte14: value[14],
            byte15: value[15],
        }
    }
}

impl From<CFUUIDBytes> for [u8; 16] {
    #[inline]
    fn from(value: CFUUIDBytes) -> Self {
        [
            value.byte0,
            value.byte1,
            value.byte2,
            value.byte3,
            value.byte4,
            value.byte5,
            value.byte6,
            value.byte7,
            value.byte8,
            value.byte9,
            value.byte10,
            value.byte11,
            value.byte12,
            value.byte13,
            value.byte14,
            value.byte15,
        ]
    }
}

#[cfg(test)]
mod tests {
    use crate::CFUUID;

    #[test]
    fn eq() {
        let uuid0 = CFUUID::from_uuid_bytes(None, [016].into()).unwrap();
        let uuid1 = CFUUID::from_uuid_bytes(None, [116].into()).unwrap();
        assert_eq!(uuid0, uuid0);
        assert_ne!(uuid0, uuid1);
    }

    #[test]
    fn roundtrip() {
        let uuid = CFUUID::new(None).unwrap();
        assert_eq!(uuid, uuid);

        let bytes = uuid.uuid_bytes();
        let same_uuid = CFUUID::from_uuid_bytes(None, bytes).unwrap();
        assert_eq!(uuid, same_uuid);
    }
}

Messung V0.5 in Prozent
C=84 H=96 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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