Skip to main content

InternalFieldType

Enum InternalFieldType 

Source
pub enum InternalFieldType {
Show 20 variants UnresolvedMessage(String), UnresolvedEnum(String), Double, Float, Int64, UInt64, Int32, Fixed64, Fixed32, Bool, String, Group, Message(MessageId), Bytes, UInt32, Enum(EnumId), SFixed32, SFixed64, SInt32, SInt64,
}
Expand description

The internally tracked type of a field.

The type owns all of its data, and can refer to an internally tracked ID for resolved type references. It’s by design not possible to construct those IDs from outside this module.

Variants§

§

UnresolvedMessage(String)

A message that is yet to be resolved.

§

UnresolvedEnum(String)

An enum that is yet to be resolved.

§

Double

The double type.

§

Float

The float type.

§

Int64

The int64 type.

§

UInt64

The uint64 type.

§

Int32

The int32 type.

§

Fixed64

The fixed64 type.

§

Fixed32

The fixed32 type.

§

Bool

The bool type.

§

String

The string type.

§

Group

The group type.

§

Message(MessageId)

A resolved message type.

§

Bytes

The bytes type.

§

UInt32

The uint32 type.

§

Enum(EnumId)

A resolved enum type.

§

SFixed32

The sfixed32 type.

§

SFixed64

The sfixed64 type.

§

SInt32

The sint32 type.

§

SInt64

The sint64 type.

Implementations§

Source§

impl InternalFieldType

Source

pub fn from_proto( proto: FieldDescriptorProto_Type, type_name: &str, ) -> InternalFieldType

Converts a proto field type into a native field type.

Trait Implementations§

Source§

impl Debug for InternalFieldType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for InternalFieldType

Source§

fn eq(&self, other: &InternalFieldType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for InternalFieldType

Source§

impl StructuralPartialEq for InternalFieldType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.