pub trait TryIteratorExtTag {
// Required method
fn read_tag(&mut self) -> Result<Option<Tag>>;
}Expand description
Extension trait for reading tag from byte iterators that yield Result<u8, E>.
This trait provides a convenient method to read tag directly from
any iterator that yields Result<u8, E>, allowing proper error propagation
from I/O operations.
§Example
use ::std::io::{Cursor, Read};
use ::protobuf_core::TryIteratorExtTag;
let data = vec![0x08]; // tag 1:0 (field 1, wire type 0)
let mut reader = Cursor::new(data);
let mut iter = reader.bytes(); // Iterator<Item = Result<u8, io::Error>>
let tag = iter.read_tag().unwrap().unwrap();
assert_eq!(tag.field_number.as_u32(), 1);