Struct protobuf::UnknownFields [−][src]
Hold “unknown” fields in parsed message.
Field may be unknown if it they are added in newer version of .proto
.
Unknown fields are stored in UnknownFields
structure, so
protobuf message could process messages without losing data.
For example, in this operation: load from DB, modify, store to DB,
even when working with older .proto
file, new fields won’t be lost.
Fields
fields: Option<Box<HashMap<u32, UnknownValues>>>
The map.
Implementations
impl UnknownFields
[src]
pub fn new() -> UnknownFields
[src]
Empty unknown fields
pub fn add_fixed32(&mut self, number: u32, fixed32: u32)
[src]
Add unknown fixed 32-bit
pub fn add_fixed64(&mut self, number: u32, fixed64: u64)
[src]
Add unknown fixed 64-bit
pub fn add_varint(&mut self, number: u32, varint: u64)
[src]
Add unknown varint
pub fn add_length_delimited(&mut self, number: u32, length_delimited: Vec<u8>)
[src]
Add unknown length delimited
pub fn add_value(&mut self, number: u32, value: UnknownValue)
[src]
Add unknown value
pub fn iter<'s>(&'s self) -> UnknownFieldsIter<'s>ⓘNotable traits for UnknownFieldsIter<'s>
impl<'s> Iterator for UnknownFieldsIter<'s> type Item = (u32, &'s UnknownValues);
[src]
Notable traits for UnknownFieldsIter<'s>
impl<'s> Iterator for UnknownFieldsIter<'s> type Item = (u32, &'s UnknownValues);
Iterate over all unknowns
pub fn get(&self, field_number: u32) -> Option<&UnknownValues>
[src]
Find unknown field by number
Trait Implementations
impl Clear for UnknownFields
[src]
impl Clone for UnknownFields
[src]
fn clone(&self) -> UnknownFields
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for UnknownFields
[src]
impl Default for UnknownFields
[src]
fn default() -> UnknownFields
[src]
impl Eq for UnknownFields
[src]
impl Hash for UnknownFields
[src]
Very simple hash implementation of Hash
for UnknownFields
.
Since map is unordered, we cannot put entry hashes into hasher,
instead we summing hashes of entries.
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> IntoIterator for &'a UnknownFields
[src]
type Item = (u32, &'a UnknownValues)
The type of the elements being iterated over.
type IntoIter = UnknownFieldsIter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> UnknownFieldsIter<'a>ⓘNotable traits for UnknownFieldsIter<'s>
impl<'s> Iterator for UnknownFieldsIter<'s> type Item = (u32, &'s UnknownValues);
[src]
Notable traits for UnknownFieldsIter<'s>
impl<'s> Iterator for UnknownFieldsIter<'s> type Item = (u32, &'s UnknownValues);
impl PartialEq<UnknownFields> for UnknownFields
[src]
fn eq(&self, other: &UnknownFields) -> bool
[src]
fn ne(&self, other: &UnknownFields) -> bool
[src]
impl StructuralEq for UnknownFields
[src]
impl StructuralPartialEq for UnknownFields
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnknownFields
impl Send for UnknownFields
impl Sync for UnknownFields
impl Unpin for UnknownFields
impl UnwindSafe for UnknownFields
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,