protobuf/coded_input_stream/
input_source.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(feature = "bytes")]
use bytes::Bytes;

use crate::coded_input_stream::buf_read_or_reader::BufReadOrReader;

/// Hold all possible combinations of input source
#[derive(Debug)]
pub(crate) enum InputSource<'a> {
    Read(BufReadOrReader<'a>),
    Slice(&'a [u8]),
    #[cfg(feature = "bytes")]
    Bytes(&'a Bytes),
}