pub struct MetadataBuilder<D, Sch, Start, StIn, StOut> { /* private fields */ }
Expand description

Helper for constructing Metadata structs with defaults.

This struct uses type state to ensure at compile time that all the required fields are set. If a required field is not set, build() won’t be visible.

§Required fields

Implementations§

source§

impl MetadataBuilder<Unset, Unset, Unset, Unset, Unset>

source

pub fn new() -> Self

Creates a new instance of the builder.

source§

impl<D, Sch, Start, StIn, StOut> MetadataBuilder<D, Sch, Start, StIn, StOut>

source

pub fn version(self, version: u8) -> Self

Sets version and returns the builder.

source

pub fn dataset( self, dataset: String ) -> MetadataBuilder<String, Sch, Start, StIn, StOut>

Sets dataset and returns the builder.

source

pub fn schema( self, schema: Option<Schema> ) -> MetadataBuilder<D, Option<Schema>, Start, StIn, StOut>

Sets schema and returns the builder.

source

pub fn start(self, start: u64) -> MetadataBuilder<D, Sch, u64, StIn, StOut>

Sets start and returns the builder.

source

pub fn end(self, end: Option<NonZeroU64>) -> Self

Sets end and returns the builder.

source

pub fn limit(self, limit: Option<NonZeroU64>) -> Self

Sets limit and returns the builder.

source

pub fn stype_in( self, stype_in: Option<SType> ) -> MetadataBuilder<D, Sch, Start, Option<SType>, StOut>

Sets stype_in and returns the builder.

source

pub fn stype_out( self, stype_out: SType ) -> MetadataBuilder<D, Sch, Start, StIn, SType>

Sets stype_out and returns the builder.

source

pub fn ts_out(self, ts_out: bool) -> Self

Sets ts_out and returns the builder.

source

pub fn symbols(self, symbols: Vec<String>) -> Self

Sets symbols and returns the builder.

source

pub fn partial(self, partial: Vec<String>) -> Self

Sets partial and returns the builder.

source

pub fn not_found(self, not_found: Vec<String>) -> Self

Sets not_found and returns the builder.

source

pub fn mappings(self, mappings: Vec<SymbolMapping>) -> Self

Sets mappings and returns the builder.

source§

impl MetadataBuilder<String, Option<Schema>, u64, Option<SType>, SType>

source

pub fn build(self) -> Metadata

Constructs a Metadata object. The availability of this method indicates all required fields have been set.

Trait Implementations§

source§

impl<D: Debug, Sch: Debug, Start: Debug, StIn: Debug, StOut: Debug> Debug for MetadataBuilder<D, Sch, Start, StIn, StOut>

source§

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

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

impl Default for MetadataBuilder<Unset, Unset, Unset, Unset, Unset>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<D, Sch, Start, StIn, StOut> Freeze for MetadataBuilder<D, Sch, Start, StIn, StOut>
where D: Freeze, Sch: Freeze, StIn: Freeze, StOut: Freeze, Start: Freeze,

§

impl<D, Sch, Start, StIn, StOut> RefUnwindSafe for MetadataBuilder<D, Sch, Start, StIn, StOut>

§

impl<D, Sch, Start, StIn, StOut> Send for MetadataBuilder<D, Sch, Start, StIn, StOut>
where D: Send, Sch: Send, StIn: Send, StOut: Send, Start: Send,

§

impl<D, Sch, Start, StIn, StOut> Sync for MetadataBuilder<D, Sch, Start, StIn, StOut>
where D: Sync, Sch: Sync, StIn: Sync, StOut: Sync, Start: Sync,

§

impl<D, Sch, Start, StIn, StOut> Unpin for MetadataBuilder<D, Sch, Start, StIn, StOut>
where D: Unpin, Sch: Unpin, StIn: Unpin, StOut: Unpin, Start: Unpin,

§

impl<D, Sch, Start, StIn, StOut> UnwindSafe for MetadataBuilder<D, Sch, Start, StIn, StOut>
where D: UnwindSafe, Sch: UnwindSafe, StIn: UnwindSafe, StOut: UnwindSafe, Start: UnwindSafe,

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>,

§

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>,

§

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<T> Ungil for T
where T: Send,