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 2 kB image not shown  

Quelle  iter.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)

#[cfg(all(not(mls_build_async), feature = "rayon"))]
mod sync_rayon {
    use rayon::{
        iter::IterBridge,
        prelude::{FromParallelIterator, IntoParallelIterator, ParallelBridge, ParallelIterator},
    };

    pub fn wrap_iter<I>(it: I) -> I::Iter
    where
        I: IntoParallelIterator,
    {
        it.into_par_iter()
    }

    pub fn wrap_impl_iter<I>(it: I) -> IterBridge<I::IntoIter>
    where
        I: IntoIterator,
        I::IntoIter: Send,
        I::Item: Send,
    {
        it.into_iter().par_bridge()
    }

    pub trait ParallelIteratorExt {
        type Ok: Send;
        type Error: Send;

        fn try_collect<A>(self) -> Result<A, Self::Error>
        where
            A: FromParallelIterator<Self::Ok>;
    }

    impl<I, T, E> ParallelIteratorExt for I
    where
        I: ParallelIterator<Item = Result<T, E>>,
        T: Send,
        E: Send,
    {
        type Ok = T;
        type Error = E;

        fn try_collect<A>(self) -> Result<A, Self::Error>
        where
            A: FromParallelIterator<Self::Ok>,
        {
            self.collect()
        }
    }
}

#[cfg(all(not(mls_build_async), feature = "rayon"))]
pub use sync_rayon::{wrap_impl_iter, wrap_iter, ParallelIteratorExt};

#[cfg(not(any(mls_build_async, feature = "rayon")))]
mod sync {
    pub fn wrap_iter<I>(it: I) -> I::IntoIter
    where
        I: IntoIterator,
    {
        it.into_iter()
    }

    pub fn wrap_impl_iter<I>(it: I) -> I::IntoIter
    where
        I: IntoIterator,
    {
        it.into_iter()
    }
}

#[cfg(not(any(mls_build_async, feature = "rayon")))]
pub use sync::{wrap_impl_iter, wrap_iter};

#[cfg(mls_build_async)]
mod async_ {
    pub fn wrap_iter<I>(it: I) -> futures::stream::Iter<I::IntoIter>
    where
        I: IntoIterator,
    {
        futures::stream::iter(it)
    }

    pub fn wrap_impl_iter<I>(it: I) -> futures::stream::Iter<I::IntoIter>
    where
        I: IntoIterator,
    {
        futures::stream::iter(it)
    }
}

#[cfg(mls_build_async)]
pub use async_::{wrap_impl_iter, wrap_iter};

Messung V0.5 in Prozent
C=66 H=93 G=80

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