ItemBuilder

Struct ItemBuilder 

Source
pub struct ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,
{ /* private fields */ }
Expand description

Builder for an InputItem, OutputItem, or FeatureItem.

Only flags that differ from the default need to be set, the most common invocations of this builder are a variation of:

let item: InputItem = ItemBuilder::new()
           .variable()
           .absolute()
           .input();
let item: OutputItem = ItemBuilder::new()
           .constant()
           .output();
let item: FeatureItem = ItemBuilder::new()
           .array()
           .relative()
           .feature();

Implementations§

Source§

impl ItemBuilder<IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined>

Source

pub fn new() -> ItemBuilder<IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined, IBUndefined>

Create a new builder for an InputItem, OutputItem or FeatureItem. Each flag on the builder may only be set once, complete the item by calling ItemBuilder::input(), ItemBuilder::output() or ItemBuilder::feature().

let item: InputItem = ItemBuilder::new()
           .data()
           .variable()
           .absolute()
           .input();

Where an item flag is not set the default (unset) is used. See Section 6.2.2.5 “Input, Output, and Feature Items” for details on default flags.

Source§

impl<A, B, C, D, E, F, G, H, I> ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn input(self) -> InputItem

Convert the current builder to an InputItem.

let item: InputItem = ItemBuilder::new()
           .data()
           .variable()
           .absolute()
           .input();
assert!(item.is_data() && !item.is_constant());
assert!(item.is_variable() && !item.is_array());
assert!(item.is_absolute() && !item.is_relative());
Source

pub fn output(self) -> OutputItem

Convert the current builder to an OutputItem.

let item: OutputItem = ItemBuilder::new()
           .data()
           .variable()
           .absolute()
           .output();
assert!(item.is_data() && !item.is_constant());
assert!(item.is_variable() && !item.is_array());
assert!(item.is_absolute() && !item.is_relative());
Source

pub fn feature(self) -> FeatureItem

Convert the current builder to a FeatureItem.

let item: FeatureItem = ItemBuilder::new()
           .data()
           .variable()
           .absolute()
           .feature();
assert!(item.is_data() && !item.is_constant());
assert!(item.is_variable() && !item.is_array());
assert!(item.is_absolute() && !item.is_relative());
Source§

impl<B, C, D, E, F, G, H, I> ItemBuilder<IBUndefined, B, C, D, E, F, G, H, I>
where B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn constant(self) -> ItemBuilder<IBConstant, B, C, D, E, F, G, H, I>

Set the item data to be constant.

Source

pub fn data(self) -> ItemBuilder<IBData, B, C, D, E, F, G, H, I>

Set the item data to be data. This is the default.

Source§

impl<A, C, D, E, F, G, H, I> ItemBuilder<A, IBUndefined, C, D, E, F, G, H, I>
where A: IBSData, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn variable(self) -> ItemBuilder<A, IBVariable, C, D, E, F, G, H, I>

Set the item data to be a variable

Source

pub fn array(self) -> ItemBuilder<A, IBArray, C, D, E, F, G, H, I>

Set the item data to be an array. This is the default.

Source§

impl<A, B, D, E, F, G, H, I> ItemBuilder<A, B, IBUndefined, D, E, F, G, H, I>
where A: IBSData, B: IBSArr, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn absolute(self) -> ItemBuilder<A, B, IBAbsolute, D, E, F, G, H, I>

Set the item data to represent absolute values. This is the default.

Source

pub fn relative(self) -> ItemBuilder<A, B, IBRelative, D, E, F, G, H, I>

Set the item data to represent relative values.

Source§

impl<A, B, C, E, F, G, H, I> ItemBuilder<A, B, C, IBUndefined, E, F, G, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn wrap(self) -> ItemBuilder<A, B, C, IBWrap, E, F, G, H, I>

Set the item data to wrap at the logical extents.

Source

pub fn nowrap(self) -> ItemBuilder<A, B, C, IBNoWrap, E, F, G, H, I>

Set the item data to not wrap at the logical extents. This is the default.

Source§

impl<A, B, C, D, F, G, H, I> ItemBuilder<A, B, C, D, IBUndefined, F, G, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, F: IBSPref, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn linear(self) -> ItemBuilder<A, B, C, D, IBLinear, F, G, H, I>

Set the item data to be linear.

Source

pub fn nonlinear(self) -> ItemBuilder<A, B, C, D, IBNonLinear, F, G, H, I>

Set the item data to be non linear. This is the default.

Source§

impl<A, B, C, D, E, G, H, I> ItemBuilder<A, B, C, D, E, IBUndefined, G, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, G: IBSNull, H: IBSBit, I: IBSVol,

Source

pub fn preferred_state(self) -> ItemBuilder<A, B, C, D, E, IBPreferred, G, H, I>

Set the item data to have a preferred state.

Source

pub fn no_preferred_state( self, ) -> ItemBuilder<A, B, C, D, E, IBNoPreferred, G, H, I>

Set the item data to not have a preferred state. This is the default.

Source§

impl<A, B, C, D, E, F, H, I> ItemBuilder<A, B, C, D, E, F, IBUndefined, H, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, H: IBSBit, I: IBSVol,

Source

pub fn null(self) -> ItemBuilder<A, B, C, D, E, F, IBNull, H, I>

Set the item data to have a null state

Source

pub fn no_null(self) -> ItemBuilder<A, B, C, D, E, F, IBNoNull, H, I>

Set the item data to not have a null state. This is the default.

Source§

impl<A, B, C, D, E, F, G, I> ItemBuilder<A, B, C, D, E, F, G, IBUndefined, I>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, I: IBSVol,

Source

pub fn bitfield(self) -> ItemBuilder<A, B, C, D, E, F, G, IBBitfield, I>

Set the item data to be a bit field. This is the default.

Source

pub fn buffered_bytes(self) -> ItemBuilder<A, B, C, D, E, F, G, IBBuffered, I>

Set the item data to be stream of buffered bytes.

Source§

impl<A, B, C, D, E, F, G, H> ItemBuilder<A, B, C, D, E, F, G, H, IBUndefined>
where A: IBSData, B: IBSArr, C: IBSAbs, D: IBSWrap, E: IBSLin, F: IBSPref, G: IBSNull, H: IBSBit,

Source

pub fn volatile(self) -> ItemBuilder<A, B, C, D, E, F, G, H, IBVolatile>

Set the item data to be volatile.

If the builder is later converted to an InputItem this flag is ignored.

Source

pub fn non_volatile(self) -> ItemBuilder<A, B, C, D, E, F, G, H, IBNonVolatile>

Set the item data to be stream of buffered bytes.

If the builder is later converted to an InputItem this flag is ignored.

Trait Implementations§

Source§

impl<A, B, C, D, E, F, G, H, I> Default for ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: IBSData + Default, B: IBSArr + Default, C: IBSAbs + Default, D: IBSWrap + Default, E: IBSLin + Default, F: IBSPref + Default, G: IBSNull + Default, H: IBSBit + Default, I: IBSVol + Default,

Source§

fn default() -> ItemBuilder<A, B, C, D, E, F, G, H, I>

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

Auto Trait Implementations§

§

impl<A, B, C, D, E, F, G, H, I> Freeze for ItemBuilder<A, B, C, D, E, F, G, H, I>

§

impl<A, B, C, D, E, F, G, H, I> RefUnwindSafe for ItemBuilder<A, B, C, D, E, F, G, H, I>

§

impl<A, B, C, D, E, F, G, H, I> Send for ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: Send, B: Send, C: Send, D: Send, E: Send, F: Send, G: Send, H: Send, I: Send,

§

impl<A, B, C, D, E, F, G, H, I> Sync for ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: Sync, B: Sync, C: Sync, D: Sync, E: Sync, F: Sync, G: Sync, H: Sync, I: Sync,

§

impl<A, B, C, D, E, F, G, H, I> Unpin for ItemBuilder<A, B, C, D, E, F, G, H, I>
where A: Unpin, B: Unpin, C: Unpin, D: Unpin, E: Unpin, F: Unpin, G: Unpin, H: Unpin, I: Unpin,

§

impl<A, B, C, D, E, F, G, H, I> UnwindSafe for ItemBuilder<A, B, C, D, E, F, G, H, I>

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.