pub struct FieldType {
pub type_id: u8,
pub capacity: u64,
pub string_capacity: u64,
pub nested_type_name: String,
}Expand description
Type information for a field
Fields§
§type_id: u8Type ID from FieldType.msg constants
capacity: u64Array/sequence capacity (0 if not applicable)
string_capacity: u64String capacity (0 if not applicable)
nested_type_name: StringNested type name (empty if not a nested type)
Implementations§
Source§impl FieldType
impl FieldType
Sourcepub fn nested_sequence(type_name: impl Into<String>) -> Self
pub fn nested_sequence(type_name: impl Into<String>) -> Self
Create an unbounded sequence of nested types (Vec
Sourcepub fn array(base_type_id: u8, capacity: u64) -> Self
pub fn array(base_type_id: u8, capacity: u64) -> Self
Create a fixed-size array field type (e.g., [T; N]) For nested types: [NestedType; N] For primitives: [primitive; N]
Sourcepub fn nested_array(type_name: impl Into<String>, capacity: u64) -> Self
pub fn nested_array(type_name: impl Into<String>, capacity: u64) -> Self
Create a fixed-size array of nested types
Sourcepub fn string_with_capacity(type_id: u8, string_capacity: u64) -> Self
pub fn string_with_capacity(type_id: u8, string_capacity: u64) -> Self
Create a string field type with capacity
Sourcepub fn bounded_string(string_capacity: u64) -> Self
pub fn bounded_string(string_capacity: u64) -> Self
Create a bounded string (string with maximum size)
Sourcepub fn bounded_wstring(string_capacity: u64) -> Self
pub fn bounded_wstring(string_capacity: u64) -> Self
Create a bounded wstring (wide string with maximum size)
Sourcepub fn bounded_sequence(base_type_id: u8, capacity: u64) -> Self
pub fn bounded_sequence(base_type_id: u8, capacity: u64) -> Self
Create a bounded sequence of primitives
Sourcepub fn bounded_sequence_with_string_capacity(
base_type_id: u8,
capacity: u64,
string_capacity: u64,
) -> Self
pub fn bounded_sequence_with_string_capacity( base_type_id: u8, capacity: u64, string_capacity: u64, ) -> Self
Create a bounded sequence with string_capacity for bounded string elements
Used for sequence<string
Sourcepub fn sequence_with_string_capacity(
base_type_id: u8,
string_capacity: u64,
) -> Self
pub fn sequence_with_string_capacity( base_type_id: u8, string_capacity: u64, ) -> Self
Create an unbounded sequence with string_capacity for bounded string elements
Used for sequence<string
Sourcepub fn nested_bounded_sequence(
type_name: impl Into<String>,
capacity: u64,
) -> Self
pub fn nested_bounded_sequence( type_name: impl Into<String>, capacity: u64, ) -> Self
Create a bounded sequence of nested types