Skip to main content

Fuid

Struct Fuid 

Source
#[repr(transparent)]
pub struct Fuid<H>(pub u64_be, _);
Expand description
  • 64bit id [–timestamp(40)–|–shard_id(8)–|–seq_id(16)–]
  • 40 bit - timestamp (in milliseconds) started from 2023-04-09 0:00:00 UTC, 34 years available (from 2023 to 2057)
  • 8 bit - shard_id ([datacenter_id / instance_id] with thread_id), 256 values
  • 16 bit - random sequence id (unique for thread / per thread), 65_536 values
  • Blowfish for encryption
  • ZBASE32 for encoding into 13 length string (example: “ifs1gp9dw8hdw”)
  • create ~ 50ns (~ 21k in 1ms or 21m in 1s) in 1 thread

Notes:

  • checks timestamp and shard_id when deserialized from string
  • Fuid is not inlined for InlineArray

Tuple Fields§

§0: u64_be

Implementations§

Source§

impl<H> Fuid<H>

Source

pub fn from_thread() -> Self

Source

pub fn with_inst_thread(instance_id: u64, thread_id: u64) -> Self

  • 3 bit - instance id (datacenter id / shard id) (max 7)
  • 5 bit - thread id (max 31)
  • instance_id (datacenter) < 8 and thread_id (worker) < 32
Source

pub fn with_shard(shard_id: u64) -> Self

Create a new Fuid.

  • shard_id < 256
Source

pub fn timestamp(&self) -> u64

unix timestamp in milliseconds

Source

pub fn date(&self) -> OffsetDateTime

Source

pub fn get(&self) -> u64

get LE u64

Source

pub fn to_be_bytes(self) -> [u8; 8]

Source

pub fn from_be_bytes(bytes: [u8; 8]) -> Self

Source

pub fn to_bytes(self) -> [u8; 8]

to BE bytes

Source

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

from BE bytes

Source

pub fn to_u64(self) -> u64

to BE u64

Source

pub fn from_u64(bytes: u64) -> Self

from BE u64

Source

pub fn to_le_bytes(self) -> [u8; 8]

Source

pub fn instance_id(&self) -> u64

Source

pub fn thread_id(&self) -> u64

Source

pub fn shard_id(&self) -> u64

Source

pub fn format<W>(&self, w: &mut W) -> Result<(), Error>
where W: Write,

id: {id:#x}; {id:#b}; {dt}-{instance_id}-{thread_id}-{seq}

Source

pub fn date_prefix(ms: u64) -> [u8; 8]

return prefix for date [–timestamp(5)–|0x00(1)|0x0000(2)] ms - unix timestamp in milliseconds

Source

pub fn check(&self) -> Result<(), ArmourError>

Source

pub fn increment(self) -> Self

only for iterator with excluded bounds

Source

pub fn group_id(&self) -> u32

group_id for this Fuid (12 days one group)

Source§

impl<H: IdHasher> Fuid<H>

Source

pub fn ser(self) -> IdStr

Source

pub fn deser(id: &str) -> Result<Self, ArmourError>

Source§

impl Fuid<()>

Source

pub fn ser(self) -> IdStr

Source

pub fn deser(id: &str) -> Result<Self, ArmourError>

Trait Implementations§

Source§

impl<T> AsRef<[u8; 8]> for Fuid<T>

Source§

fn as_ref(&self) -> &[u8; 8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> AsRef<Fuid<T>> for Fuid<T>

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Clone for Fuid<T>

Source§

fn clone(&self) -> Self

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<H> Debug for Fuid<H>

Source§

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

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

impl<'de> Deserialize<'de> for Fuid<()>

Available on crate feature std only.
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<'de, T: IdHasher> Deserialize<'de> for Fuid<T>

Available on crate feature std only.
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 Fuid<()>

Source§

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

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

impl<H: IdHasher> Display for Fuid<H>

Source§

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

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

impl<H> From<Fuid<H>> for OptFuid<H>

Source§

fn from(id: Fuid<H>) -> Self

Converts to this type from the input type.
Source§

impl<H> FromBytes for Fuid<H>

Source§

fn ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the given source as a &Self. Read more
Source§

fn ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: KnownLayout + Immutable,

Interprets the prefix of the given source as a &Self without copying. Read more
Source§

fn ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>
where Self: Immutable + KnownLayout,

Interprets the suffix of the given bytes as a &Self. Read more
Source§

fn mut_from_bytes( source: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the given source as a &mut Self. Read more
Source§

fn mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the prefix of the given source as a &mut Self without copying. Read more
Source§

fn mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>
where Self: IntoBytes + KnownLayout,

Interprets the suffix of the given source as a &mut Self without copying. Read more
Source§

fn read_from_bytes(source: &[u8]) -> Result<Self, SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the given source. Read more
Source§

fn read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the prefix of the given source. Read more
Source§

fn read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), SizeError<&[u8], Self>>
where Self: Sized,

Reads a copy of Self from the suffix of the given source. Read more
Source§

impl FromStr for Fuid<()>

Source§

type Err = ArmourError

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

fn from_str(s: &str) -> Result<Self, ArmourError>

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

impl<T: IdHasher> FromStr for Fuid<T>

Source§

type Err = ArmourError

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

fn from_str(s: &str) -> Result<Self, ArmourError>

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

impl<H> FromZeros for Fuid<H>

Source§

fn zero(&mut self)

Overwrites self with zeros. Read more
Source§

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
Source§

impl<H> GetType for Fuid<H>

Source§

const TYPE: Typ = Typ::Fuid

Source§

impl<H: Hash> Hash for Fuid<H>

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<H> IntoBytes for Fuid<H>

Source§

fn as_bytes(&self) -> &[u8]
where Self: Immutable,

Gets the bytes of this value. Read more
Source§

fn as_mut_bytes(&mut self) -> &mut [u8]
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
Source§

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
Source§

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
Source§

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
Source§

impl<H> KeyPart for Fuid<H>

Source§

const TY: KeyType = KeyType::Fuid

Source§

const PREFIX_BITS: u32 = MILLISECOND_BITS

Source§

impl<H> KnownLayout for Fuid<H>
where Self: Sized,

Source§

type PointerMetadata = ()

The type of metadata stored in a pointer to Self. Read more
Source§

fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>

Computes the size of an object of type Self with the given pointer metadata. Read more
Source§

impl<T> Ord for Fuid<T>

Source§

fn cmp(&self, other: &Self) -> 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,

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

impl<T> PartialEq<[u8; 8]> for Fuid<T>

Source§

fn eq(&self, other: &[u8; 8]) -> 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> PartialEq<Fuid<T>> for [u8; 8]

Source§

fn eq(&self, other: &Fuid<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> PartialEq<Fuid<T>> for OptFuid<T>

Source§

fn eq(&self, other: &Fuid<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> PartialEq<Fuid<T>> for Option<Fuid<T>>

Source§

fn eq(&self, other: &Fuid<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> PartialEq<OptFuid<T>> for Fuid<T>

Source§

fn eq(&self, other: &OptFuid<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> PartialEq<Option<Fuid<T>>> for Fuid<T>

Source§

fn eq(&self, other: &Option<Fuid<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> PartialEq for Fuid<T>

Source§

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

Source§

fn partial_cmp(&self, other: &Self) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rapira for Fuid<()>

Source§

const STATIC_SIZE: Option<usize>

Source§

const MIN_SIZE: usize = 8

Source§

fn size(&self) -> usize

size of bytes for serialize
Source§

fn check_bytes(slice: &mut &[u8]) -> Result<()>

check bytes, collections len, check utf-8, NonZero, f32 and others…
Source§

fn from_slice(slice: &mut &[u8]) -> Result<Self>
where Self: Sized,

this is safe, but not check collections capacity! recommend use only for safe data (example: from DB), not external data.
Source§

fn convert_to_bytes(&self, slice: &mut [u8], cursor: &mut usize)

Source§

fn debug_from_slice(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized + Debug,

Source§

unsafe fn from_slice_unchecked(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized,

Safety Read more
Source§

unsafe fn from_slice_unsafe(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized,

Safety Read more
Source§

fn from_slice_versioned( slice: &mut &[u8], _version: u8, ) -> Result<Self, RapiraError>
where Self: Sized,

Deserialize with schema version awareness. Read more
Source§

fn try_convert_to_bytes( &self, slice: &mut [u8], cursor: &mut usize, ) -> Result<(), RapiraError>

Source§

fn convert_to_bytes_ctx( &self, slice: &mut [u8], cursor: &mut usize, _flags: RapiraFlags, )

Context-aware serialization. Default: delegates to convert_to_bytes.
Source§

fn from_slice_ctx( slice: &mut &[u8], _flags: RapiraFlags, ) -> Result<Self, RapiraError>
where Self: Sized,

Context-aware deserialization. Default: delegates to from_slice.
Source§

fn size_ctx(&self, _flags: RapiraFlags) -> usize

Context-aware size calculation. Default: delegates to size.
Source§

impl<H: IdHasher> Rapira for Fuid<H>

only check if non-zero, not check valid byte mask

Source§

const STATIC_SIZE: Option<usize>

Source§

const MIN_SIZE: usize = 8

Source§

fn size(&self) -> usize

size of bytes for serialize
Source§

fn check_bytes(slice: &mut &[u8]) -> Result<()>

check bytes, collections len, check utf-8, NonZero, f32 and others…
Source§

fn from_slice(slice: &mut &[u8]) -> Result<Self>
where Self: Sized,

this is safe, but not check collections capacity! recommend use only for safe data (example: from DB), not external data.
Source§

fn convert_to_bytes(&self, slice: &mut [u8], cursor: &mut usize)

Source§

fn convert_to_bytes_ctx( &self, slice: &mut [u8], cursor: &mut usize, flags: RapiraFlags, )

Context-aware serialization. Default: delegates to convert_to_bytes.
Source§

fn from_slice_ctx(slice: &mut &[u8], flags: RapiraFlags) -> Result<Self>
where Self: Sized,

Context-aware deserialization. Default: delegates to from_slice.
Source§

fn debug_from_slice(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized + Debug,

Source§

unsafe fn from_slice_unchecked(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized,

Safety Read more
Source§

unsafe fn from_slice_unsafe(slice: &mut &[u8]) -> Result<Self, RapiraError>
where Self: Sized,

Safety Read more
Source§

fn from_slice_versioned( slice: &mut &[u8], _version: u8, ) -> Result<Self, RapiraError>
where Self: Sized,

Deserialize with schema version awareness. Read more
Source§

fn try_convert_to_bytes( &self, slice: &mut [u8], cursor: &mut usize, ) -> Result<(), RapiraError>

Source§

fn size_ctx(&self, _flags: RapiraFlags) -> usize

Context-aware size calculation. Default: delegates to size.
Source§

impl Serialize for Fuid<()>

Available on crate feature std only.
Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

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

impl<T: IdHasher> Serialize for Fuid<T>

Available on crate feature std only.
Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

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

impl<H> TransparentWrapper<u64_be> for Fuid<H>

Source§

fn wrap(s: Inner) -> Self
where Self: Sized,

Convert the inner type into the wrapper type.
Source§

fn wrap_ref(s: &Inner) -> &Self

Convert a reference to the inner type into a reference to the wrapper type.
Source§

fn wrap_mut(s: &mut Inner) -> &mut Self

Convert a mutable reference to the inner type into a mutable reference to the wrapper type.
Source§

fn wrap_slice(s: &[Inner]) -> &[Self]
where Self: Sized,

Convert a slice to the inner type into a slice to the wrapper type.
Source§

fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]
where Self: Sized,

Convert a mutable slice to the inner type into a mutable slice to the wrapper type.
Source§

fn peel(s: Self) -> Inner
where Self: Sized,

Convert the wrapper type into the inner type.
Source§

fn peel_ref(s: &Self) -> &Inner

Convert a reference to the wrapper type into a reference to the inner type.
Source§

fn peel_mut(s: &mut Self) -> &mut Inner

Convert a mutable reference to the wrapper type into a mutable reference to the inner type.
Source§

fn peel_slice(s: &[Self]) -> &[Inner]
where Self: Sized,

Convert a slice to the wrapped type into a slice to the inner type.
Source§

fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]
where Self: Sized,

Convert a mutable slice to the wrapped type into a mutable slice to the inner type.
Source§

impl TryFrom<&str> for Fuid<()>

Source§

type Error = ArmourError

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

fn try_from(val: &str) -> Result<Self, ArmourError>

Performs the conversion.
Source§

impl<T: IdHasher> TryFrom<&str> for Fuid<T>

Source§

type Error = ArmourError

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

fn try_from(val: &str) -> Result<Self, ArmourError>

Performs the conversion.
Source§

impl<H> TryFromBytes for Fuid<H>

Source§

fn try_ref_from_bytes( source: &[u8], ) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the given source as a &Self. Read more
Source§

fn try_ref_from_prefix( source: &[u8], ) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the prefix of the given source as a &Self. Read more
Source§

fn try_ref_from_suffix( source: &[u8], ) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: KnownLayout + Immutable,

Attempts to interpret the suffix of the given source as a &Self. Read more
Source§

fn try_mut_from_bytes( bytes: &mut [u8], ) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the given source as a &mut Self without copying. Read more
Source§

fn try_mut_from_prefix( source: &mut [u8], ) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the prefix of the given source as a &mut Self. Read more
Source§

fn try_mut_from_suffix( source: &mut [u8], ) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>
where Self: KnownLayout + IntoBytes,

Attempts to interpret the suffix of the given source as a &mut Self. Read more
Source§

fn try_read_from_bytes( source: &[u8], ) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read the given source as a Self. Read more
Source§

fn try_read_from_prefix( source: &[u8], ) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the prefix of the given source. Read more
Source§

fn try_read_from_suffix( source: &[u8], ) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>
where Self: Sized,

Attempts to read a Self from the suffix of the given source. Read more
Source§

impl<T> Zeroable for Fuid<T>

Source§

fn zeroed() -> Self

Source§

impl<T> Copy for Fuid<T>

Source§

impl<T> Eq for Fuid<T>

Source§

impl<H> Immutable for Fuid<H>

Source§

impl<T: 'static> Pod for Fuid<T>

Auto Trait Implementations§

§

impl<H> Freeze for Fuid<H>

§

impl<H> RefUnwindSafe for Fuid<H>
where H: RefUnwindSafe,

§

impl<H> Send for Fuid<H>
where H: Send,

§

impl<H> Sync for Fuid<H>
where H: Sync,

§

impl<H> Unpin for Fuid<H>
where H: Unpin,

§

impl<H> UnsafeUnpin for Fuid<H>

§

impl<H> UnwindSafe for Fuid<H>
where H: 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> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<I, T> TransparentWrapperAlloc<I> for T
where T: TransparentWrapper<I> + ?Sized, I: ?Sized,

Source§

fn wrap_vec(s: Vec<Inner>) -> Vec<Self>
where Self: Sized,

Convert a vec of the inner type into a vec of the wrapper type.
Source§

fn wrap_box(s: Box<Inner>) -> Box<Self>

Convert a box to the inner type into a box to the wrapper type.
Source§

fn wrap_rc(s: Rc<Inner>) -> Rc<Self>

Convert an Rc to the inner type into an Rc to the wrapper type.
Source§

fn wrap_arc(s: Arc<Inner>) -> Arc<Self>

Convert an Arc to the inner type into an Arc to the wrapper type.
Source§

fn peel_vec(s: Vec<Self>) -> Vec<Inner>
where Self: Sized,

Convert a vec of the wrapper type into a vec of the inner type.
Source§

fn peel_box(s: Box<Self>) -> Box<Inner>

Convert a box to the wrapper type into a box to the inner type.
Source§

fn peel_rc(s: Rc<Self>) -> Rc<Inner>

Convert an Rc to the wrapper type into an Rc to the inner type.
Source§

fn peel_arc(s: Arc<Self>) -> Arc<Inner>

Convert an Arc to the wrapper type into an Arc to the inner type.
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

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

Source§

impl<T> NoUninit for T
where T: Pod,