protobuf/coded_input_stream/input_source.rs
1#[cfg(feature = "bytes")]
2use bytes::Bytes;
3
4use crate::coded_input_stream::buf_read_or_reader::BufReadOrReader;
5
6/// Hold all possible combinations of input source
7#[derive(Debug)]
8pub(crate) enum InputSource<'a> {
9 Read(BufReadOrReader<'a>),
10 #[allow(dead_code)] // Keep the field to clarify we logically hold the reference.
11 Slice(&'a [u8]),
12 #[cfg(feature = "bytes")]
13 Bytes(&'a Bytes),
14}