Struct tarantool::uuid::Uuid

source ·
pub struct Uuid { /* private fields */ }

Implementations§

source§

impl Uuid

source

pub fn random() -> Self

source

pub fn from_inner(inner: Uuid) -> Self

source

pub fn into_inner(self) -> Uuid

source

pub fn from_bytes(bytes: [u8; 16]) -> Self

Convert an array of bytes in the big endian order into a Uuid.

source

pub fn try_from_slice(bytes: &[u8]) -> Option<Self>

Convert a slice of bytes in the big endian order into a Uuid. Return None if there’s not enough bytes in the slice.

source

pub fn from_tt_uuid(tt: tt_uuid) -> Self

Convert the tarantool native (little endian) uuid representation into a Uuid.

source

pub fn to_tt_uuid(&self) -> tt_uuid

Return an array of bytes in tarantool native (little endian) format

source

pub fn as_bytes(&self) -> &[u8; 16]

Return an array of bytes in the big endian order

source

pub fn nil() -> Self

The ‘nil UUID’.

The nil UUID is special form of UUID that is specified to have all 128 bits set to zero, as defined in IETF RFC 4122 Section 4.1.7.

Examples

Basic usage:

use uuid::Uuid;

let uuid = Uuid::nil();

assert_eq!(
    uuid.to_hyphenated().to_string(),
    "00000000-0000-0000-0000-000000000000"
);
source

pub fn is_nil(&self) -> bool

Tests if the UUID is nil.

source

pub fn parse_str(input: &str) -> Result<Self, Error>

Parses a Uuid from a string of hexadecimal digits with optional hyphens.

Any of the formats generated by this module (simple, hyphenated, urn) are supported by this parsing function.

source

pub const fn to_hyphenated(self) -> Hyphenated

Get a Hyphenated formatter.

source

pub const fn to_hyphenated_ref(&self) -> HyphenatedRef<'_>

Get a borrowed HyphenatedRef formatter.

source

pub const fn to_simple(self) -> Simple

Get a Simple formatter.

source

pub const fn to_simple_ref(&self) -> SimpleRef<'_>

Get a borrowed SimpleRef formatter.

source

pub const fn to_urn(self) -> Urn

Get a Urn formatter.

source

pub const fn to_urn_ref(&self) -> UrnRef<'_>

Get a borrowed UrnRef formatter.

Trait Implementations§

source§

impl Clone for Uuid

source§

fn clone(&self) -> Uuid

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 Uuid

source§

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

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

impl Default for Uuid

source§

fn default() -> Uuid

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

impl<'de> Deserialize<'de> for Uuid

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 Display for Uuid

source§

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

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

impl From<Uuid> for Uuid

source§

fn from(inner: Uuid) -> Self

Converts to this type from the input type.
source§

impl From<Uuid> for Uuid

source§

fn from(uuid: Uuid) -> Self

Converts to this type from the input type.
source§

impl FromStr for Uuid

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(uuid_str: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Uuid

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for Uuid

source§

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

Formats the value using the given formatter.
source§

impl<L> LuaRead<L> for Uuid
where L: AsLua,

source§

fn lua_read_at_position(lua: L, index: NonZeroI32) -> ReadResult<Self, L>

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

fn n_values_expected() -> i32

source§

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

Reads the data from Lua.
source§

fn lua_read_at_maybe_zero_position( lua: L, index: i32 ) -> Result<Self, (L, WrongType)>
where L: AsLua,

source§

impl Ord for Uuid

source§

fn cmp(&self, other: &Uuid) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Uuid

source§

fn eq(&self, other: &Uuid) -> 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 PartialOrd for Uuid

source§

fn partial_cmp(&self, other: &Uuid) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<L: AsLua> Push<L> for Uuid

§

type Err = Void

Error that can happen when pushing a value.
source§

fn push_to_lua(&self, lua: L) -> Result<PushGuard<L>, (Self::Err, L)>

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<L: AsLua> PushInto<L> for Uuid

§

type Err = Void

source§

fn push_into_lua(self, lua: L) -> Result<PushGuard<L>, (Self::Err, L)>

Push the value into lua by value
source§

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

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

impl Serialize for Uuid

Tuple

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 UpperHex for Uuid

source§

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

Formats the value using the given formatter.
source§

impl Copy for Uuid

source§

impl Eq for Uuid

source§

impl<L: AsLua> PushOne<L> for Uuid

source§

impl<L: AsLua> PushOneInto<L> for Uuid

source§

impl StructuralEq for Uuid

source§

impl StructuralPartialEq for Uuid

Auto Trait Implementations§

§

impl RefUnwindSafe for Uuid

§

impl Send for Uuid

§

impl Sync for Uuid

§

impl Unpin for Uuid

§

impl UnwindSafe for Uuid

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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>,