Struct msi::ColumnBuilder

source ·
pub struct ColumnBuilder { /* private fields */ }
Expand description

A factory for configuring a new database column.

Implementations§

source§

impl ColumnBuilder

source

pub fn localizable(self) -> ColumnBuilder

Makes the column be localizable.

source

pub fn nullable(self) -> ColumnBuilder

Makes the column allow null values.

source

pub fn primary_key(self) -> ColumnBuilder

Makes the column be a primary key column.

source

pub fn range(self, min: i32, max: i32) -> ColumnBuilder

Makes the column only permit values in the given range.

source

pub fn foreign_key(self, table_name: &str, column_index: i32) -> ColumnBuilder

Makes the column refer to a key column in another table.

source

pub fn category(self, category: Category) -> ColumnBuilder

For string columns, makes the column use the specified data format.

source

pub fn enum_values(self, values: &[&str]) -> ColumnBuilder

Makes the column only permit the given values.

source

pub fn int16(self) -> Column

Builds a column that stores a 16-bit integer.

source

pub fn int32(self) -> Column

Builds a column that stores a 32-bit integer.

source

pub fn string(self, max_len: usize) -> Column

Builds a column that stores a string.

source

pub fn id_string(self, max_len: usize) -> Column

Builds a column that stores an identifier string. This is equivalent to self.category(Category::Identifier).string(max_len).

source

pub fn text_string(self, max_len: usize) -> Column

Builds a column that stores a text string. This is equivalent to self.category(Category::Text).string(max_len).

source

pub fn formatted_string(self, max_len: usize) -> Column

Builds a column that stores a formatted string. This is equivalent to self.category(Category::Formatted).string(max_len).

source

pub fn binary(self) -> Column

Builds a column that refers to a binary data stream. This sets the category to Category::Binary in addition to setting the column type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.