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

Quelle  either.rs

  Sprache: Rust
 

use pin_project_lite::pin_project;
use std::{
    future::Future,
    pin::Pin,
    task::{Context, Poll},
};

pin_project! {
    /// One of two possible futures that have the same output type.
    #[project = EitherProj]
    pub(crateenum Either<F1, F2> {
        Left {
            #[pin]
            fut: F1
        },
        Right {
            #[pin]
            fut: F2,
        },
    }
}

impl<F1, F2> Either<F1, F2> {
    pub(cratefn left(fut: F1) -> Self {
        Either::Left { fut }
    }

    pub(cratefn right(fut: F2) -> Self {
        Either::Right { fut }
    }
}

impl<F1, F2> Future for Either<F1, F2>
where
    F1: Future,
    F2: Future<Output = F1::Output>,
{
    type Output = F1::Output;

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        match self.project() {
            EitherProj::Left { fut } => fut.poll(cx),
            EitherProj::Right { fut } => fut.poll(cx),
        }
    }
}

Messung V0.5 in Prozent
C=98 H=100 G=98

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