pub struct Builder<'a> { /* private fields */ }
Implementations§
source§impl<'a> Builder<'a>
impl<'a> Builder<'a>
pub fn new(name: &'a str) -> Self
pub fn if_not_exists(self, if_not_exists: bool) -> Self
pub fn engine(self, engine: SpaceEngineType) -> Self
pub fn id(self, id: u32) -> Self
pub fn field_count(self, field_count: u32) -> Self
pub fn user(self, user: String) -> Self
pub fn is_local(self, is_local: bool) -> Self
pub fn is_temporary(self, is_temporary: bool) -> Self
pub fn is_sync(self, is_sync: bool) -> Self
sourcepub fn field(self, field: impl Into<Field>) -> Self
pub fn field(self, field: impl Into<Field>) -> Self
Add a field to the space’s format.
Use this method to set each field individually or use format
to set
fields in bulk. The difference is purely syntactical.
sourcepub fn format(self, format: impl IntoIterator<Item = impl Into<Field>>) -> Self
pub fn format(self, format: impl IntoIterator<Item = impl Into<Field>>) -> Self
Add fields to the space’s format.
Use this method to set fields in bulk or use field
to set
each field individually. The difference is purely syntactical.
use tarantool::space::{Space, FieldType as FT, IsNullable};
let space = Space::builder("user_names")
.format([
("id", FT::Unsigned),
("name", FT::String),
])
.field(("nickname", FT::String, IsNullable::Nullable))
.create();
sourcepub fn into_parts(self) -> (&'a str, SpaceCreateOptions)
pub fn into_parts(self) -> (&'a str, SpaceCreateOptions)
Destructure the builder struct into a tuple of name and space options.