Home
last modified time | relevance | path

Searched full:either (Results 1 – 25 of 23184) sorted by relevance

12345678910>>...928

/external/deqp/framework/common/
DtcuEither.cpp15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * \brief Template class that is either type of Left or Right.
86 const Either<int, float> either(intValue); in Either_selfTest() local
88 TCU_CHECK(either.isFirst()); in Either_selfTest()
89 TCU_CHECK(!either.isSecond()); in Either_selfTest()
91 TCU_CHECK(either.is<int>()); in Either_selfTest()
92 TCU_CHECK(!either.is<float>()); in Either_selfTest()
94 TCU_CHECK(either.getFirst() == intValue); in Either_selfTest()
95 TCU_CHECK(either.get<int>() == intValue); in Either_selfTest()
101 const Either<int, float> either(floatValue); in Either_selfTest() local
[all …]
DtcuEither.hpp17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * \brief Template class that is either type of First or Second.
32 * \brief Object containing Either First or Second type of object
40 class Either class
43 Either(const First &first);
44 Either(const Second &second);
45 ~Either(void);
47 Either(const Either<First, Second> &other);
48 Either &operator=(const Either<First, Second> &other);
50 Either &operator=(const First &first);
[all …]
/external/rust/crates/futures-util/src/future/
Deither.rs13 /// use futures::future::Either;
19 /// Either::Left(async move { 12 })
21 /// Either::Right(async move { 44 })
28 pub enum Either<A, B> { enum
35 impl<A, B> Either<A, B> { impl
36 /// Convert `Pin<&Either<A, B>>` to `Either<Pin<&A>, Pin<&B>>`,
38 pub fn as_pin_ref(self: Pin<&Self>) -> Either<Pin<&A>, Pin<&B>> { in as_pin_ref()
43 Either::Left(ref inner) => Either::Left(Pin::new_unchecked(inner)), in as_pin_ref()
44 Either::Right(ref inner) => Either::Right(Pin::new_unchecked(inner)), in as_pin_ref()
49 /// Convert `Pin<&mut Either<A, B>>` to `Either<Pin<&mut A>, Pin<&mut B>>`,
[all …]
Dselect.rs2 use crate::future::{Either, FutureExt};
16 /// Waits for either one of two differently-typed futures to complete.
18 /// This function will return a new future which awaits for either one of both
26 /// output type you can use the `Either::factor_first` method to
37 /// future::Either,
55 /// Either::Left((value1, _)) => value1, // `value1` is resolved from `future1`
57 /// Either::Right((value2, _)) => value2, // `value2` is resolved from `future2`
68 /// use futures::future::{self, Either, Future, FutureExt};
76 /// future::select(a, b).then(|either| {
77 /// match either {
[all …]
Dtry_select.rs1 use crate::future::{Either, TryFutureExt};
15 type EitherOk<A, B> = Either<(<A as TryFuture>::Ok, B), (<B as TryFuture>::Ok, A)>;
16 type EitherErr<A, B> = Either<(<A as TryFuture>::Error, B), (<B as TryFuture>::Error, A)>;
18 /// Waits for either one of two differently-typed futures to complete.
20 /// This function will return a new future which awaits for either one of both
28 /// success/error type you can use the `Either::factor_first` method to
34 /// use futures::future::{self, Either, Future, FutureExt, TryFuture, TryFutureExt};
45 /// Ok(Either::Left((x, b))) => Box::new(b.map_ok(move |y| (x, y))),
46 /// Ok(Either::Right((y, a))) => Box::new(a.map_ok(move |x| (x, y))),
47 /// Err(Either::Left((e, _))) => Box::new(future::err(e)),
[all …]
/external/aws-sdk-java-v2/utils/src/test/java/software/amazon/awssdk/utils/
DEitherTest.java11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
29 Either.left(null); in leftValueNull_ThrowsException()
34 Either.right(null); in rightValueNull_ThrowsException()
39 final Either<String, Integer> either = Either.left("left val"); in mapWhenLeftValuePresent_OnlyCallsLeftFunction() local
40 final Boolean mapped = either.map(s -> { in mapWhenLeftValuePresent_OnlyCallsLeftFunction()
50 final Either<String, Integer> either = Either.right(42); in mapWhenRightValuePresent_OnlyCallsRightFunction() local
51 final Boolean mapped = either.map(this::assertNotCalled, in mapWhenRightValuePresent_OnlyCallsRightFunction()
62 final Either<String, Integer> either = Either.left(value); in mapLeftWhenLeftValuePresent_OnlyMapsLeftValue() local
63 either.mapLeft(String::hashCode) in mapLeftWhenLeftValuePresent_OnlyMapsLeftValue()
71 final Either<String, Integer> either = Either.right(value); in mapLeftWhenLeftValueNotPresent_DoesNotMapValue() local
[all …]
/external/rust/crates/either/src/
Dlib.rs1 //! The enum [`Either`] with variants `Left` and `Right` is a general purpose
4 //! [`Either`]: enum.Either.html
12 //! Disabled by default. Enable to `#[derive(Serialize, Deserialize)]` for `Either`
15 #![doc(html_root_url = "https://docs.rs/either/1/")]
40 pub use crate::Either::{Left, Right};
42 /// The enum `Either` with variants `Left` and `Right` is a general purpose
45 /// The `Either` type is symmetric and treats its variants the same way, without
50 pub enum Either<L, R> { enum
57 /// Evaluate the provided expression for both [`Either::Left`] and [`Either::Right`].
59 /// This macro is useful in cases where both sides of [`Either`] can be interacted with
[all …]
Dserde_untagged.rs1 //! Untagged serialization/deserialization support for Either<L, R>.
3 //! `Either` uses default, externally-tagged representation.
10 //! use either::Either;
16 //! #[serde(with = "either::serde_untagged")]
17 //! inner: Either<Vec<String>, HashMap<String, i32>>
22 //! inner: Either::Left(vec!["Hello".to_string()])
40 enum Either<L, R> { enum
45 pub fn serialize<L, R, S>(this: &super::Either<L, R>, serializer: S) -> Result<S::Ok, S::Error> in serialize()
52 super::Either::Left(left) => Either::Left(left), in serialize()
53 super::Either::Right(right) => Either::Right(right), in serialize()
[all …]
Dserde_untagged_optional.rs1 //! Untagged serialization/deserialization support for Option<Either<L, R>>.
3 //! `Either` uses default, externally-tagged representation.
10 //! use either::Either;
16 //! #[serde(with = "either::serde_untagged_optional")]
17 //! inner: Option<Either<Vec<String>, HashMap<String, i32>>>
22 //! inner: Some(Either::Left(vec!["Hello".to_string()]))
40 enum Either<L, R> { enum
46 this: &Option<super::Either<L, R>>, in serialize()
55 Some(super::Either::Left(left)) => Some(Either::Left(left)), in serialize()
56 Some(super::Either::Right(right)) => Some(Either::Right(right)), in serialize()
[all …]
/external/aws-sdk-java-v2/utils/src/main/java/software/amazon/awssdk/utils/
DEither.java11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
30 public final class Either<L, R> { class
35 private Either(Optional<L> l, Optional<R> r) { in Either() method in Either
41 …* Maps the Either to a type and returns the resolved value (which may be from the left or the righ…
46 * @return Mapped value from either lFunc or rFunc depending on which value is present.
55 * Map the left most value and return a new Either reflecting the new types.
59 * @return New Either bound to the new left type and the same right type.
61 public <T> Either<T, R> mapLeft(Function<? super L, ? extends T> lFunc) { in mapLeft()
62 return new Either<>(left.map(lFunc), right); in mapLeft()
66 * Map the right most value and return a new Either reflecting the new types.
[all …]
/external/mobile-data-download/javatests/com/google/android/libraries/mobiledatadownload/internal/util/
DEitherTest.java12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 // ImmutableList ensures the Either List isn't modified by sortedEquals.
39 assertThat(Either.sortedEquals(Either.makeLeft(LIST), Either.makeLeft(LIST), COMPARATOR)) in sortedEquals_comparesSortedList()
42 Either.sortedEquals(Either.makeLeft(LIST), Either.makeLeft(JUMBLED_LIST), COMPARATOR)) in sortedEquals_comparesSortedList()
45 assertThat(Either.sortedEquals(Either.makeLeft(LIST), Either.makeLeft(OTHER_LIST), COMPARATOR)) in sortedEquals_comparesSortedList()
51 assertThat(Either.sortedEquals(Either.makeLeft(LIST), null, COMPARATOR)).isFalse(); in sortedEquals_handlesNull()
52 assertThat(Either.sortedEquals(Either.makeLeft(LIST), Either.makeLeft(null), COMPARATOR)) in sortedEquals_handlesNull()
55 assertThat(Either.sortedEquals(Either.makeLeft(null), Either.makeLeft(null), COMPARATOR)) in sortedEquals_handlesNull()
57 assertThat(Either.sortedEquals(null, null, COMPARATOR)).isTrue(); in sortedEquals_handlesNull()
/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/internal/util/
DEither.java12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 /** An object that contains either one of the left field or right field, but not both. */
26 public final class Either<A, B> { class
32 private Either(boolean hasLeft, @Nullable A left, @Nullable B right) { in Either() method in Either
38 public static <A, B> Either<A, B> makeLeft(A left) { in makeLeft()
39 return new Either<>(true, left, null); in makeLeft()
42 public static <A, B> Either<A, B> makeRight(B right) { in makeRight()
43 return new Either<>(false, null, right); in makeRight()
56 throw new IllegalStateException("Either was not left"); in getLeft()
63 throw new IllegalStateException("Either was not right"); in getRight()
[all …]
/external/kotlinx.serialization/formats/json-tests/commonTest/src/kotlinx/serialization/json/
DJsonTreeAndMapperTest.kt19 sealed class Either { class
20 data class Left(val errorMsg: String) : Either()
21 data class Right(val data: Payload) : Either()
24 object EitherSerializer : KSerializer<Either> {
25 …override val descriptor: SerialDescriptor = buildSerialDescriptor("Either", PolymorphicKind.SEALED… in <lambda>()
26 val leftDescriptor = buildClassSerialDescriptor("Either.Left") { in <lambda>()
29 val rightDescriptor = buildClassSerialDescriptor("Either.Right") { in <lambda>()
36 override fun deserialize(decoder: Decoder): Either { in deserialize()
40 if ("error" in tree) return Either.Left(tree.getValue("error").jsonPrimitive.content) in deserialize()
42 return Either.Right(input.json.decodeFromJsonElement(Payload.serializer(), tree)) in deserialize()
[all …]
DJsonEncoderDecoderRecursiveTest.kt28 assertEquals(Either.Right(Payload(42, 43, "Hello world")), payload) in <lambda>()
38 assertEquals(Either.Left("Connection timed out"), payload) in <lambda>()
45 val outputData = Event(0, Either.Right(Payload(42, 43, "Hello world")), 1000) in <lambda>()
52 val outputData = Event(0, Either.Right(Payload(42, 43, "Hello world")), 1000) in <lambda>()
67 val outputError = Event(1, Either.Left("Connection timed out"), 1001) in <lambda>()
77 assertEquals(Either.Right(Payload(42, 43, "Hello world")), payload) in <lambda>()
87 assertEquals(Either.Left("Connection timed out"), payload) in <lambda>()
94 val outputData = Event(0, Either.Right(Payload(42, 43, "Hello world")), 1000) in <lambda>()
101 val outputError = Event(1, Either.Left("Connection timed out"), 1001) in <lambda>()
121 private sealed class Either { in <lambda>() class in kotlinx.serialization.json.JsonEncoderDecoderRecursiveTest
[all …]
/external/rust/crates/either/
DREADME.rst2 Either title
5 The enum ``Either`` with variants ``Left`` and ``Right`` and trait
8 Either has methods that are similar to Option and Result.
15 __ https://docs.rs/either/
19 .. |build_status| image:: https://github.com/bluss/either/workflows/CI/badge.svg?branch=master
20 .. _build_status: https://github.com/bluss/either/actions
22 .. |crates| image:: https://img.shields.io/crates/v/either.svg
23 .. _crates: https://crates.io/crates/either
28 either = "1.8"
44 - **MSRV**: ``either`` now requires Rust 1.36 or later.
[all …]
/external/rust/crates/tokio-util/src/
Deither.rs1 //! Module defining an Either type.
40 /// When the output type is the same, we can wrap each future in `Either` to avoid the
44 /// use tokio_util::either::Either;
52 /// Either::Left(some_async_function())
54 /// Either::Right(other_async_function())
64 pub enum Either<L, R> { enum
70 … It takes an invocation of method as an argument (e.g. `self.poll(cx)`), and redirects it to either
83 impl<L, R, O> Future for Either<L, R> implementation
95 impl<L, R> AsyncRead for Either<L, R> implementation
109 impl<L, R> AsyncBufRead for Either<L, R> implementation
[all …]
/external/rust/crates/tower/src/util/
Deither.rs1 //! Contains [`Either`] and related types and functions.
3 //! See [`Either`] documentation for more details.
18 /// [`Either`] is useful for handling conditional branching in service middleware
22 pub enum Either<A, B> { enum
29 impl<A, B, Request> Service<Request> for Either<A, B> implementation
38 type Future = Either<A::Future, B::Future>;
41 use self::Either::*; in poll_ready()
50 use self::Either::*; in call()
59 impl<A, B, T, AE, BE> Future for Either<A, B> implementation
76 impl<S, A, B> Layer<S> for Either<A, B> implementation
[all …]
/external/ms-tpm-20-ref/TPMCmd/tpm/include/
DTpmBuildSwitches.h39 // The switches are guarded so that they can either be set on the command line or
43 // to the default value. The default can either be YES or NO as indicated on each line
51 // not be a proper expression If you want to test various switches, either use the
78 # define DEBUG YES // Default: Either YES or NO
87 # define USE_BN_ECC_DATA YES // Default: Either YES or NO
93 // debug code. SIMULATION Needs to be defined as either YES or NO. This grouping of
102 # define SIMULATION YES // Default: Either YES or NO
111 # define LIBRARY_COMPATIBILITY_CHECK YES // Default: Either YES or NO
116 # define FIPS_COMPLIANT YES // Default: Either YES or NO
123 # define USE_DA_USED YES // Default: Either YES or NO
[all …]
/external/rust/crates/tokio-util/src/net/
Dmod.rs3 use crate::either::Either;
65 impl<L, R> Either<L, R> implementation
71 pub async fn accept(&mut self) -> Result<Either<(L::Io, L::Addr), (R::Io, R::Addr)>> { in accept()
73 Either::Left(listener) => { in accept()
75 Ok(Either::Left((stream, addr))) in accept()
77 Either::Right(listener) => { in accept()
79 Ok(Either::Right((stream, addr))) in accept()
85 pub fn local_addr(&self) -> Result<Either<L::Addr, R::Addr>> { in local_addr()
87 Either::Left(listener) => { in local_addr()
89 Ok(Either::Left(addr)) in local_addr()
[all …]
/external/kotlinx.serialization/formats/json/commonMain/src/kotlinx/serialization/json/
DJsonDecoder.kt17 * // Class representing Either<Left|Right>
18 * sealed class Either {
19 * data class Left(val errorMsg: String) : Either()
20 * data class Right(val data: Payload) : Either()
24 * object EitherSerializer : KSerializer<Either> {
25 …* override val descriptor: SerialDescriptor = buildSerialDescriptor("package.Either", Polymorp…
29 * override fun deserialize(decoder: Decoder): Either {
32 * if ("error" in tree) return Either.Left(tree["error"]!!.jsonPrimitive.content)
33 * return Either.Right(input.json.decodeFromJsonElement(Payload.serializer(), tree))
36 * override fun serialize(encoder: Encoder, value: Either) {
[all …]
DJsonEncoder.kt15 * // Class representing Either<Left|Right>
16 * sealed class Either {
17 * data class Left(val errorMsg: String) : Either()
18 * data class Right(val data: Payload) : Either()
22 * object EitherSerializer : KSerializer<Either> {
23 …* override val descriptor: SerialDescriptor = buildSerialDescriptor("package.Either", Polymorp…
27 * override fun deserialize(decoder: Decoder): Either {
30 * if ("error" in tree) return Either.Left(tree["error"]!!.jsonPrimitive.content)
31 * return Either.Right(input.json.decodeFromJsonElement(Payload.serializer(), tree))
34 * override fun serialize(encoder: Encoder, value: Either) {
[all …]
/external/rust/crates/itertools/src/
Dexactly_one_err.rs7 use either::Either;
24 first_two: Option<Either<[I::Item; 2], I::Item>>,
33 pub(crate) fn new(first_two: Option<Either<[I::Item; 2], I::Item>>, inner: I) -> Self { in new()
39 Some(Either::Left(_)) => 2, in additional_len()
40 Some(Either::Right(_)) => 1, in additional_len()
54 Some(Either::Left([first, second])) => { in next()
55 self.first_two = Some(Either::Right(second)); in next()
58 Some(Either::Right(second)) => { in next()
94 Some(Either::Left([first, second])) => { in fmt()
97 Some(Either::Right(second)) => { in fmt()
/external/arm-trusted-firmware/plat/xilinx/versal/pm_service/
Dpm_api_sys.c81 * @return Returns status, either success or error+reason
122 * @return Returns status, either success or error+reason
161 * @return Returns status, either success or error+reason
189 * @return Returns status, either success or error+reason
217 * This API function is either used to power up another APU core for SMP
222 * @return Returns status, either success or error+reason
245 * @return Returns status, either success or error+reason
265 * @return Returns status, either success or error+reason
287 * @return Returns status, either success or error+reason
309 * @return Returns status, either success or error+reason
[all …]
/external/tpm2-tss/doc/
Ddoxygen.dox119 * either as a one-call or in an asynchronous manner.
127 * either as a one-call or in an asynchronous manner.
135 * either as a one-call or in an asynchronous manner.
143 * either as a one-call or in an asynchronous manner.
151 * either as a one-call or in an asynchronous manner.
159 * either as a one-call or in an asynchronous manner.
165 * either as a one-call or in an asynchronous manner.
175 * either as a one-call or in an asynchronous manner.
183 * either as a one-call or in an asynchronous manner.
191 * either as a one-call or in an asynchronous manner.
[all …]
/external/arm-trusted-firmware/plat/xilinx/zynqmp/pm_service/
Dpm_api_sys.c82 * @return Returns status, either success or error+reason
112 * @return Returns status, either success or error+reason
137 * This API function is either used to power up another APU core for SMP
142 * @return Returns status, either success or error+reason
173 * @return Returns status, either success or error+reason
197 * @return Returns status, either success or error+reason
221 * @return Returns status, either success or error+reason
239 * @return Returns status, either success or error+reason
264 * @return Returns status, either success or error+reason
290 * @return Returns status, either success or error+reason
[all …]

12345678910>>...928