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: SpaceId) -> Self
pub fn field_count(self, field_count: u32) -> Self
pub fn user(self, user: String) -> Self
pub fn space_type(self, space_type: SpaceType) -> Self
pub fn is_local(self, is_local: bool) -> Self
👎Deprecated: use Builder::space_type instead
pub fn temporary(self, temporary: bool) -> Self
👎Deprecated: use Builder::space_type instead
pub fn is_sync(self, is_sync: bool) -> Self
👎Deprecated: use Builder::space_type instead
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 create(self) -> Result<Space>
pub fn create(self) -> Result<Space>
Create a space with the current configuration.
NOTE: This function will initiate a transaction if there’s isn’t an active one, and if there is the active transaction may be aborted in case of an error. This shouldn’t be a problem if you always consider this function returning an error to be worthy of a transcation roll back, which you should.
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.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Builder<'a>
impl<'a> Send for Builder<'a>
impl<'a> Sync for Builder<'a>
impl<'a> Unpin for Builder<'a>
impl<'a> UnwindSafe for Builder<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more