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

Quelle  extension.rs

  Sprache: Rust
 

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Copyright by contributors to this project.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)

pub use mls_rs_core::extension::{ExtensionType, MlsCodecExtension, MlsExtension};

pub(crateuse built_in::*;

/// Default extension types required by the MLS RFC.
pub mod built_in;

#[cfg(test)]
pub(cratemod test_utils {
    use alloc::vec::Vec;
    use core::convert::Infallible;
    use core::fmt::Debug;
    use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
    use mls_rs_core::extension::MlsExtension;

    use super::*;

    pub const TEST_EXTENSION_TYPE: u16 = 42;

    #[derive(MlsSize, MlsEncode, MlsDecode, Clone, Debug, PartialEq)]
    pub(cratestruct TestExtension {
        pub(crate) foo: u8,
    }

    impl From<u8> for TestExtension {
        fn from(value: u8) -> Self {
            Self { foo: value }
        }
    }

    impl MlsExtension for TestExtension {
        type SerializationError = Infallible;

        type DeserializationError = Infallible;

        fn extension_type() -> ExtensionType {
            ExtensionType::from(TEST_EXTENSION_TYPE)
        }

        fn to_bytes(&self) -> Result<Vec<u8>, Self::SerializationError> {
            Ok([self.foo].to_vec())
        }

        fn from_bytes(data: &[u8]) -> Result<SelfSelf::DeserializationError> {
            Ok(TestExtension { foo: data[0] })
        }
    }
}

Messung V0.5 in Prozent
C=65 H=94 G=80

¤ Dauer der Verarbeitung: 0.16 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.