s2n_quic_core/stream/type_.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4/// The Stream Type defines whether data can be transmitted in both directions
5/// or only in a single direction.
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum StreamType {
8 /// Data can be transmitted on the Stream in both directions
9 Bidirectional,
10 /// Data can be transmitted on the Stream only in a single direction
11 Unidirectional,
12}
13
14impl StreamType {
15 pub fn is_bidirectional(self) -> bool {
16 self == StreamType::Bidirectional
17 }
18
19 pub fn is_unidirectional(self) -> bool {
20 self == StreamType::Unidirectional
21 }
22}