#[non_exhaustive]pub struct FieldDef { /* private fields */ }Expand description
A single field within a schema: a name and a FieldType.
Implementations§
Source§impl FieldDef
impl FieldDef
Sourcepub fn new(name: impl Into<String>, field_type: FieldType) -> Self
pub fn new(name: impl Into<String>, field_type: FieldType) -> Self
Construct a field definition with the given name and type.
FieldDef::new("worker_id", FieldType::Varint);
FieldDef::new("tags", FieldType::DynamicList);Sourcepub fn field_type(&self) -> FieldType
pub fn field_type(&self) -> FieldType
Wire type used to encode this field.
Trait Implementations§
impl Eq for FieldDef
impl StructuralPartialEq for FieldDef
Auto Trait Implementations§
impl Freeze for FieldDef
impl RefUnwindSafe for FieldDef
impl Send for FieldDef
impl Sync for FieldDef
impl Unpin for FieldDef
impl UnsafeUnpin for FieldDef
impl UnwindSafe for FieldDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more