Struct RecordFieldBuilder

Source
pub struct RecordFieldBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> RecordFieldBuilder<S>

Source

pub fn build(self) -> RecordField
where S: IsComplete,

Finish building and return the requested object

Source

pub fn name(self, value: String) -> RecordFieldBuilder<SetName<S>>
where S::Name: IsUnset,

Required.

Name of the field.

Source

pub fn doc(self, value: Documentation) -> RecordFieldBuilder<SetDoc<S>>
where S::Doc: IsUnset,

Optional (Some / Option setters). Default: <Documentation as Default>::default().

Documentation of the field.

Source

pub fn maybe_doc( self, value: Option<Documentation>, ) -> RecordFieldBuilder<SetDoc<S>>
where S::Doc: IsUnset,

Optional (Some / Option setters). Default: <Documentation as Default>::default().

Documentation of the field.

Source

pub fn aliases(self, value: Vec<String>) -> RecordFieldBuilder<SetAliases<S>>
where S::Aliases: IsUnset,

Optional (Some / Option setters).

Aliases of the field’s name. They have no namespace.

Source

pub fn maybe_aliases( self, value: Option<Vec<String>>, ) -> RecordFieldBuilder<SetAliases<S>>
where S::Aliases: IsUnset,

Optional (Some / Option setters).

Aliases of the field’s name. They have no namespace.

Source

pub fn default(self, value: Value) -> RecordFieldBuilder<SetDefault<S>>
where S::Default: IsUnset,

Optional (Some / Option setters).

Default value of the field. This value will be used when reading Avro datum if schema resolution is enabled.

Source

pub fn maybe_default( self, value: Option<Value>, ) -> RecordFieldBuilder<SetDefault<S>>
where S::Default: IsUnset,

Optional (Some / Option setters).

Default value of the field. This value will be used when reading Avro datum if schema resolution is enabled.

Source

pub fn schema(self, value: Schema) -> RecordFieldBuilder<SetSchema<S>>
where S::Schema: IsUnset,

Required.

Schema of the field.

Source

pub fn order(self, value: RecordFieldOrder) -> RecordFieldBuilder<SetOrder<S>>
where S::Order: IsUnset,

Optional (Some / Option setters). Default: RecordFieldOrder::Ignore.

Order of the field.

NOTE This currently has no effect.

Source

pub fn maybe_order( self, value: Option<RecordFieldOrder>, ) -> RecordFieldBuilder<SetOrder<S>>
where S::Order: IsUnset,

Optional (Some / Option setters). Default: RecordFieldOrder::Ignore.

Order of the field.

NOTE This currently has no effect.

Source

pub fn position(self, value: usize) -> RecordFieldBuilder<SetPosition<S>>
where S::Position: IsUnset,

Optional (Some / Option setters). Default: 0.

Position of the field in the list of field of its parent Schema

Source

pub fn maybe_position( self, value: Option<usize>, ) -> RecordFieldBuilder<SetPosition<S>>
where S::Position: IsUnset,

Optional (Some / Option setters). Default: 0.

Position of the field in the list of field of its parent Schema

Source

pub fn custom_attributes( self, value: BTreeMap<String, Value>, ) -> RecordFieldBuilder<SetCustomAttributes<S>>
where S::CustomAttributes: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

A collection of all unknown fields in the record field.

Source

pub fn maybe_custom_attributes( self, value: Option<BTreeMap<String, Value>>, ) -> RecordFieldBuilder<SetCustomAttributes<S>>
where S::CustomAttributes: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

A collection of all unknown fields in the record field.

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V