Struct tarantool::index::Metadata

source ·
pub struct Metadata<'a> {
    pub space_id: SpaceId,
    pub index_id: IndexId,
    pub name: Cow<'a, str>,
    pub type: IndexType,
    pub opts: BTreeMap<Cow<'a, str>, Value<'a>>,
    pub parts: Vec<Part>,
}
Expand description

Representation of a tuple holding index metadata in system _index space.

Fields§

§space_id: SpaceId§index_id: IndexId§name: Cow<'a, str>§type: IndexType§opts: BTreeMap<Cow<'a, str>, Value<'a>>§parts: Vec<Part>

Implementations§

source§

impl Metadata<'_>

source

pub fn to_key_def(&self) -> KeyDef

Construct a KeyDef instance from index parts.

Panicking

Will panic if any of the parts have field name instead of field number. Normally this doesn’t happen, because Metadata returned from _index always has field number, but if you got this metadata from somewhere else, use Self::try_to_key_def instead, to check for this error.

source

pub fn try_to_key_def(&self) -> Result<KeyDef, FieldMustBeNumber>

Construct a KeyDef instance from index parts. Returns error in case any of the parts had field name instead of field number.

source

pub fn to_key_def_for_key(&self) -> KeyDef

Construct a KeyDef instance from index parts for comparing keys only.

The difference between this function and Self::to_key_def is that the latter is used to compare tuples of a space, while the former is used to compare only the keys.

Trait Implementations§

source§

impl<'a> Clone for Metadata<'a>

source§

fn clone(&self) -> Metadata<'a>

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<'a> Debug for Metadata<'a>

source§

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

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

impl<'a> Default for Metadata<'a>

source§

fn default() -> Metadata<'a>

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

impl<'de, 'a> Deserialize<'de> for Metadata<'a>

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 Encode for Metadata<'_>

source§

fn encode(&self, w: &mut impl Write) -> Result<()>

source§

impl<'a> PartialEq for Metadata<'a>

source§

fn eq(&self, other: &Metadata<'a>) -> 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<'a> Serialize for Metadata<'a>

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 TryFrom<&Metadata<'_>> for KeyDef

§

type Error = FieldMustBeNumber

The type returned in the event of a conversion error.
source§

fn try_from(meta: &Metadata<'_>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> Eq for Metadata<'a>

source§

impl<'a> StructuralEq for Metadata<'a>

source§

impl<'a> StructuralPartialEq for Metadata<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Metadata<'a>

§

impl<'a> Send for Metadata<'a>

§

impl<'a> Sync for Metadata<'a>

§

impl<'a> Unpin for Metadata<'a>

§

impl<'a> UnwindSafe for Metadata<'a>

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> ToTupleBuffer for T
where T: Encode + ?Sized,

source§

fn write_tuple_data(&self, w: &mut impl Write) -> Result<(), Error>

source§

fn to_tuple_buffer(&self) -> Result<TupleBuffer>

source§

fn tuple_data(&self) -> Option<&[u8]>

Returns a slice of bytes represeting the underlying tarantool tuple. 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>,