• Home
  • Raw
  • Download

Lines Matching +full:d3 +full:- +full:dispatch

1 // Copyright 2013-2014 The Rust Project Developers.
4 // See the COPYRIGHT file at the top-level directory of this distribution.
6 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
26 /// lower-level API than the methods on [`Uuid`].
57 /// * [Nil UUID in RFC4122](https://tools.ietf.org/html/rfc4122.html#section-4.1.7)
68 /// "00000000-0000-0000-0000-000000000000",
72 pub const fn nil() -> Self { in nil()
83 …Version 4](https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-04#section
94 /// "ffffffff-ffff-ffff-ffff-ffffffffffff",
98 pub const fn max() -> Self { in max()
112 /// let d3 = 0xc1c2;
115 /// let uuid = Uuid::from_fields(d1, d2, d3, &d4);
118 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
122 pub const fn from_fields(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Uuid { in from_fields()
130 (d3 >> 8) as u8,
131 d3 as u8,
143 /// Creates a UUID from four field values in little-endian order.
145 /// The bytes in the `d1`, `d2` and `d3` fields will be flipped to convert
146 /// into big-endian order. This is based on the endianness of the UUID,
158 /// let d3 = 0xc1c2;
161 /// let uuid = Uuid::from_fields_le(d1, d2, d3, &d4);
164 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8",
168 pub const fn from_fields_le(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Uuid { in from_fields_le()
176 d3 as u8,
177 (d3 >> 8) as u8,
202 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
206 pub const fn from_u128(v: u128) -> Self { in from_u128()
227 /// Creates a UUID from a 128bit value in little-endian order.
229 /// The entire value will be flipped to convert into big-endian order.
245 /// "d8d7d6d5-d4d3-d2d1-c2c1-b2b1a4a3a2a1",
249 pub const fn from_u128_le(v: u128) -> Self { in from_u128_le()
284 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
288 pub const fn from_u64_pair(high_bits: u64, low_bits: u64) -> Self { in from_u64_pair()
320 /// # fn main() -> Result<(), uuid::Error> {
332 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
338 pub fn from_slice(b: &[u8]) -> Result<Uuid, Error> { in from_slice()
361 /// # fn main() -> Result<(), uuid::Error> {
374 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8"
379 pub fn from_slice_le(b: &[u8]) -> Result<Uuid, Error> { in from_slice_le()
396 /// # fn main() -> Result<(), uuid::Error> {
409 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
415 pub const fn from_bytes(bytes: Bytes) -> Uuid { in from_bytes()
428 /// # fn main() -> Result<(), uuid::Error> {
440 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8",
446 pub const fn from_bytes_le(b: Bytes) -> Uuid { in from_bytes_le()
460 /// # fn main() -> Result<(), uuid::Error> {
473 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
484 pub fn from_bytes_ref(bytes: &Bytes) -> &Uuid { in from_bytes_ref()
489 // NOTE: There is no `from_u128_ref` because in little-endian
513 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
517 pub const fn from_bytes(b: Bytes) -> Self { in from_bytes()
530 /// # fn main() -> Result<(), uuid::Error> {
542 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8",
548 pub const fn from_bytes_le(b: Bytes) -> Self { in from_bytes_le()
553 pub const fn from_rfc4122_timestamp(ticks: u64, counter: u16, node_id: &[u8; 6]) -> Self { in from_rfc4122_timestamp()
558 pub const fn from_md5_bytes(md5_bytes: Bytes) -> Self { in from_md5_bytes()
583 pub const fn from_random_bytes(random_bytes: Bytes) -> Self { in from_random_bytes()
589 /// Creates a `Builder` for a version 5 UUID using the supplied SHA-1 hashed bytes.
591 /// This method assumes the bytes are already a SHA-1 hash, it will only set the appropriate
593 pub const fn from_sha1_bytes(sha1_bytes: Bytes) -> Self { in from_sha1_bytes()
606 ) -> Self {
623 /// # fn main() -> Result<(), Box<dyn std::error::Error>> {
639 pub const fn from_unix_timestamp_millis(millis: u64, random_bytes: &[u8; 10]) -> Self { in from_unix_timestamp_millis()
646 /// Creates a `Builder` for a version 8 UUID using the supplied user-defined bytes.
650 pub const fn from_custom_bytes(custom_bytes: Bytes) -> Self { in from_custom_bytes()
668 /// # fn main() -> Result<(), uuid::Error> {
679 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
685 pub fn from_slice(b: &[u8]) -> Result<Self, Error> { in from_slice()
703 /// # fn main() -> Result<(), uuid::Error> {
714 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8",
720 pub fn from_slice_le(b: &[u8]) -> Result<Self, Error> { in from_slice_le()
734 /// let d3 = 0xc1c2;
737 /// let uuid = Builder::from_fields(d1, d2, d3, &d4).into_uuid();
741 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
744 pub const fn from_fields(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self { in from_fields()
745 Builder(Uuid::from_fields(d1, d2, d3, d4))
758 /// let d3 = 0xc1c2;
761 /// let uuid = Builder::from_fields_le(d1, d2, d3, &d4).into_uuid();
765 /// "a4a3a2a1-b2b1-c2c1-d1d2-d3d4d5d6d7d8"
768 pub const fn from_fields_le(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Self { in from_fields_le()
769 Builder(Uuid::from_fields_le(d1, d2, d3, d4))
785 /// "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
789 pub const fn from_u128(v: u128) -> Self { in from_u128()
793 /// Creates a UUID from a 128bit value in little-endian order.
806 /// "d8d7d6d5-d4d3-d2d1-c2c1-b2b1a4a3a2a1",
810 pub const fn from_u128_le(v: u128) -> Self { in from_u128_le()
825 /// "00000000-0000-0000-0000-000000000000",
829 pub const fn nil() -> Self { in nil()
834 pub fn set_variant(&mut self, v: Variant) -> &mut Self { in set_variant()
840 pub const fn with_variant(mut self, v: Variant) -> Self { in with_variant()
854 pub fn set_version(&mut self, v: Version) -> &mut Self { in set_version()
860 pub const fn with_version(mut self, v: Version) -> Self { in with_version()
881 pub const fn as_uuid(&self) -> &Uuid { in as_uuid()
897 /// "00000000-0000-0000-0000-000000000000"
900 pub const fn into_uuid(self) -> Uuid { in into_uuid()