Struct tarantool::space::Field

source ·
pub struct Field {
    pub name: String,
    pub field_type: FieldType,
    pub is_nullable: bool,
}

Fields§

§name: String§field_type: FieldType§is_nullable: bool

Implementations§

source§

impl Field

source

pub fn new(name: &str, ft: FieldType) -> Self

👎Deprecated: Use one of Field::any, Field::unsigned, Field::string, etc. instead

Create a new field format specifier.

You should use one of the other constructors instead

source

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

Specify if the current field can be nullable or not. This method captures self by value and returns it, so it should be used in a builder fashion.

use tarantool::space::Field;
let f = Field::string("middle name").is_nullable(true);
source

pub fn any(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “any”

source

pub fn unsigned(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “unsigned”

source

pub fn string(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “string”

source

pub fn number(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “number”

source

pub fn double(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “double”

source

pub fn integer(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “integer”

source

pub fn boolean(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “boolean”

source

pub fn varbinary(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “varbinary”

source

pub fn scalar(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “scalar”

source

pub fn decimal(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “decimal”

source

pub fn uuid(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “uuid”

source

pub fn datetime(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “datetime”

source

pub fn interval(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “interval”

source

pub fn array(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “array”

source

pub fn map(name: impl Into<String>) -> Self

Create a new field format specifier with the given name and type “map”

Trait Implementations§

source§

impl Clone for Field

source§

fn clone(&self) -> Field

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Field

source§

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

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

impl<'de> Deserialize<'de> for Field

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S> From<(S, FieldType)> for Field
where String: From<S>,

source§

fn from(args: (S, FieldType)) -> Self

Converts to this type from the input type.
source§

impl<S> From<(S, FieldType, IsNullable)> for Field
where String: From<S>,

source§

fn from(args: (S, FieldType, IsNullable)) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Field

source§

fn eq(&self, other: &Field) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Field

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Field

source§

impl StructuralEq for Field

source§

impl StructuralPartialEq for Field

Auto Trait Implementations§

§

impl RefUnwindSafe for Field

§

impl Send for Field

§

impl Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

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<'de, T> Decode<'de> for T
where T: Deserialize<'de>,

source§

fn decode(data: &'de [u8]) -> Result<T, Error>

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> IntoClones<(T,)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T, T)> for T
where T: Clone,

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DecodeOwned for T
where T: for<'de> Decode<'de>,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,