Part

Struct Part 

Source
pub struct Part<T = NumOrStr> {
    pub field: T,
    pub type: Option<FieldType>,
    pub collation: Option<String>,
    pub is_nullable: Option<bool>,
    pub path: Option<String>,
}
Expand description

Index part

The T generic decides what is used to identify the field. It can be either a u32 for field index or String for field name, or NumOrStr for either.

Field names are used in picodata metadata, indices are used in tarantool’s metadata, while tarantool’s index creation API can accept either.

Fields§

§field: T§type: Option<FieldType>§collation: Option<String>§is_nullable: Option<bool>§path: Option<String>

Implementations§

Source§

impl<T> Part<T>

Source

pub fn field(field: impl Into<T>) -> Self

Source

pub fn field_type(self, type: FieldType) -> Self

Source

pub fn collation(self, collation: impl Into<String>) -> Self

Source

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

Source

pub fn path(self, path: impl Into<String>) -> Self

Source

pub fn new(fi: impl Into<T>, ft: FieldType) -> Self

Trait Implementations§

Source§

impl<T: Clone> Clone for Part<T>

Source§

fn clone(&self) -> Part<T>

Returns a duplicate 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<T: Debug> Debug for Part<T>

Source§

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

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

impl<T: Default> Default for Part<T>

Source§

fn default() -> Part<T>

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

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

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 From<&str> for Part

Source§

fn from(f: &str) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Part<String>

Source§

fn from(f: &str) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, FieldType)> for Part

Source§

fn from((f, t): (&str, FieldType)) -> Self

Converts to this type from the input type.
Source§

impl From<(&str, FieldType)> for Part<String>

Source§

fn from((f, t): (&str, FieldType)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, FieldType)> for Part

Source§

fn from((f, t): (String, FieldType)) -> Self

Converts to this type from the input type.
Source§

impl From<(String, FieldType)> for Part<String>

Source§

fn from((f, t): (String, FieldType)) -> Self

Converts to this type from the input type.
Source§

impl From<(u32, FieldType)> for Part

Source§

fn from((f, t): (u32, FieldType)) -> Self

Converts to this type from the input type.
Source§

impl From<Part<String>> for Part

Source§

fn from(value: Part<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Part<u32>> for Part

Source§

fn from(value: Part<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Part

Source§

fn from(f: String) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Part<String>

Source§

fn from(f: String) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Part

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl<T, __AsLuaTypeParam> LuaRead<__AsLuaTypeParam> for Part<T>
where __AsLuaTypeParam: AsLua, T: for<'as_lua_life_time_param> LuaRead<PushGuard<&'as_lua_life_time_param __AsLuaTypeParam>>,

Source§

fn n_values_expected() -> i32

Source§

fn lua_read_at_position( __lua: __AsLuaTypeParam, __index: NonZeroI32, ) -> ReadResult<Self, __AsLuaTypeParam>

Reads the data from Lua at a given position.
Source§

fn lua_read_at_maybe_zero_position( __lua: __AsLuaTypeParam, __index: i32, ) -> ReadResult<Self, __AsLuaTypeParam>

Source§

fn lua_read(lua: L) -> Result<Self, (L, WrongType)>

Reads the data from Lua.
Source§

impl<T: PartialEq> PartialEq for Part<T>

Source§

fn eq(&self, other: &Part<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, __AsLuaTypeParam> Push<__AsLuaTypeParam> for Part<T>
where __AsLuaTypeParam: AsLua, T: PushOne<LuaState>, Void: From<<T as Push<LuaState>>::Err>,

Source§

type Err = Void

Error that can happen when pushing a value.
Source§

fn push_to_lua( &self, __lua: __AsLuaTypeParam, ) -> Result<PushGuard<__AsLuaTypeParam>, (Self::Err, __AsLuaTypeParam)>

Pushes the value on the top of the stack. Read more
Source§

fn push_no_err(&self, lua: L) -> PushGuard<L>
where Self::Err: Into<Void>,

Same as push_to_lua but can only succeed and is only available if Err implements Into<Void>.
Source§

impl<T> Serialize for Part<T>
where T: Serialize,

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<T: Eq> Eq for Part<T>

Source§

impl<T, __AsLuaTypeParam> PushOne<__AsLuaTypeParam> for Part<T>
where __AsLuaTypeParam: AsLua, T: PushOne<LuaState>, Void: From<<T as Push<LuaState>>::Err>,

Source§

impl<T> StructuralPartialEq for Part<T>

Auto Trait Implementations§

§

impl<T> Freeze for Part<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Part<T>
where T: RefUnwindSafe,

§

impl<T> Send for Part<T>
where T: Send,

§

impl<T> Sync for Part<T>
where T: Sync,

§

impl<T> Unpin for Part<T>
where T: Unpin,

§

impl<T> UnwindSafe for Part<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

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.
Source§

impl<T> DecodeOwned for T
where T: for<'de> Decode<'de>,

Source§

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