gecko-dev/third_party/rust/uuid/README.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

136 строки
4.6 KiB
Markdown
Исходник Обычный вид История

uuid
---------
[![Latest Version](https://img.shields.io/crates/v/uuid.svg)](https://crates.io/crates/uuid)
Bug 1457481 - Run mach vendor rust. r=froydnj,erahm Most importantly, this picks up "object" and "goblin" for ELF binary parsing. We only use the ELF code from goblin, so the mach-O parsing code gets eliminated by the linker. Overall, this increases the Android installer size by 20KB. Try pushes for reference: before: https://treeherder.mozilla.org/#/jobs?repo=try&revision=834b56dc5ab3d63a43a32f740ee8212296ac726d&selectedJob=201600899 after: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6983b27e8d3cb715d3b7e6cbd276683f6466e3cc&selectedJob=201600475 installer size: 34524820 -> 34542861 (34.52MB -> 34.54MB) $ mach vendor rust Updating registry `https://github.com/rust-lang/crates.io-index` Adding goblin v0.0.17 Adding memmap v0.6.2 Adding miniz-sys v0.1.10 Adding object v0.10.0 Adding parity-wasm v0.31.3 Adding plain v0.2.3 Adding profiler_helper v0.1.0 (file:///Users/mstange/code/mozilla/tools/profiler/rust-helper) Adding scroll v0.9.1 Adding scroll_derive v0.9.5 Adding syn v0.15.5 Adding thin-vec v0.1.0 Adding uuid v0.6.5 0:30.11 The following files exceed the filesize limit of 102400: third_party/rust/miniz-sys/miniz.c third_party/rust/syn-0.14.6/src/expr.rs third_party/rust/syn-0.14.6/src/gen/fold.rs third_party/rust/syn-0.14.6/src/gen/visit.rs third_party/rust/syn-0.14.6/src/gen/visit_mut.rs The syn dependency is not compiled for goblin, as far as I can tell - it's only needed for the 'syn' feature of scroll_derive, and scroll does not ask for scroll_derive/syn. object -> goblin -> scroll -> scroll_derive -/-> syn But it looks like other versions of syn were already in the tree. Depends on D7021 Differential Revision: https://phabricator.services.mozilla.com/D7023 --HG-- rename : third_party/rust/syn/src/parsers.rs => third_party/rust/syn-0.14.6/src/parsers.rs rename : third_party/rust/syn/src/verbatim.rs => third_party/rust/syn-0.14.6/src/verbatim.rs rename : third_party/rust/uuid/.travis.yml => third_party/rust/uuid-0.5.1/.travis.yml rename : third_party/rust/uuid/src/rustc_serialize.rs => third_party/rust/uuid-0.5.1/src/rustc_serialize.rs rename : third_party/rust/uuid/src/serde.rs => third_party/rust/uuid-0.5.1/src/serde.rs extra : moz-landing-system : lando
2018-10-02 04:50:56 +03:00
[![Join the chat at https://gitter.im/uuid-rs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uuid-rs/Lobby?utm_source=badge&utm_medium=badge&utm_content=badge)
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
![Minimum rustc version](https://img.shields.io/badge/rustc-1.31.0+-yellow.svg)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/uuid-rs/uuid?branch=master&svg=true)](https://ci.appveyor.com/project/uuid-rs/uuid/branch/master)
[![Build Status](https://travis-ci.org/uuid-rs/uuid.svg?branch=master)](https://travis-ci.org/uuid-rs/uuid)
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Average time to resolve an issue")
[![Percentage of issues still open](https://isitmaintained.com/badge/open/uuid-rs/uuid.svg)](https://isitmaintained.com/project/uuid-rs/uuid "Percentage of issues still open")
---
Generate and parse UUIDs.
Provides support for Universally Unique Identifiers (UUIDs). A UUID is a
unique 128-bit number, stored as 16 octets. UUIDs are used to assign
unique identifiers to entities without requiring a central allocating
authority.
They are particularly useful in distributed systems, though can be used in
disparate areas, such as databases and network protocols. Typically a UUID
is displayed in a readable string form as a sequence of hexadecimal digits,
separated into groups by hyphens.
The uniqueness property is not strictly guaranteed, however for all
practical purposes, it can be assumed that an unintentional collision would
be extremely unlikely.
## Dependencies
By default, this crate depends on nothing but `std` and cannot generate
[`Uuid`]s. You need to enable the following Cargo features to enable
various pieces of functionality:
* `v1` - adds the `Uuid::new_v1` function and the ability to create a V1
using an implementation of `uuid::v1::ClockSequence` (usually
`uuid::v1::Context`) and a timestamp from `time::timespec`.
* `v3` - adds the `Uuid::new_v3` function and the ability to create a V3
UUID based on the MD5 hash of some data.
* `v4` - adds the `Uuid::new_v4` function and the ability to randomly
generate a `Uuid`.
* `v5` - adds the `Uuid::new_v5` function and the ability to create a V5
UUID based on the SHA1 hash of some data.
* `serde` - adds the ability to serialize and deserialize a `Uuid` using the
`serde` crate.
You need to enable one of the following Cargo features together with
`v3`, `v4` or `v5` feature if you're targeting `wasm32` architecture:
* `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
`stdweb` combined with `cargo-web`
* `wasm-bindgen` - `wasm-bindgen` enables support for `OsRng` on
`wasm32-unknown-unknown` via [`wasm-bindgen`]
By default, `uuid` can be depended on with:
```toml
[dependencies]
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
uuid = "0.8"
```
To activate various features, use syntax like:
```toml
[dependencies]
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
uuid = { version = "0.8", features = ["serde", "v4"] }
```
You can disable default features with:
```toml
[dependencies]
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
uuid = { version = "0.8", default-features = false }
```
## Examples
To parse a UUID given in the simple format and print it as a urn:
```rust
use uuid::Uuid;
fn main() {
let my_uuid =
Uuid::parse_str("936DA01F9ABD4d9d80C702AF85C822A8").unwrap();
println!("{}", my_uuid.to_urn());
}
```
To create a new random (V4) UUID and print it out in hexadecimal form:
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
```rust
// Note that this requires the `v4` feature enabled in the uuid crate.
use uuid::Uuid;
fn main() {
let my_uuid = Uuid::new_v4();
println!("{}", my_uuid);
}
```
## Strings
Examples of string representations:
* simple: `936DA01F9ABD4d9d80C702AF85C822A8`
* hyphenated: `550e8400-e29b-41d4-a716-446655440000`
* urn: `urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4`
## References
* [Wikipedia: Universally Unique Identifier]( http://en.wikipedia.org/wiki/Universally_unique_identifier)
* [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace]( http://tools.ietf.org/html/rfc4122)
[`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen
Bug 1587468 - Update object to 0.16.0 and goblin to 0.1.2. r=emilio This has the side effect of adding another version of uuid, which we'll upgrade for other dependencies subsequently. Differential Revision: https://phabricator.services.mozilla.com/D55911 --HG-- rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.7.4/.cargo-checksum.json rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.7.4/Cargo.toml rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.7.4/README.md rename : third_party/rust/uuid/README.tpl => third_party/rust/uuid-0.7.4/README.tpl rename : third_party/rust/uuid/benches/format_str.rs => third_party/rust/uuid-0.7.4/benches/format_str.rs rename : third_party/rust/uuid/benches/invalid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/invalid_parse_str.rs rename : third_party/rust/uuid/benches/mod.rs => third_party/rust/uuid-0.7.4/benches/mod.rs rename : third_party/rust/uuid/benches/serde_support.rs => third_party/rust/uuid-0.7.4/benches/serde_support.rs rename : third_party/rust/uuid/benches/slog_support/mod.rs => third_party/rust/uuid-0.7.4/benches/slog_support/mod.rs rename : third_party/rust/uuid/benches/slog_support/parse_str.rs => third_party/rust/uuid-0.7.4/benches/slog_support/parse_str.rs rename : third_party/rust/uuid/benches/valid_parse_str.rs => third_party/rust/uuid-0.7.4/benches/valid_parse_str.rs rename : third_party/rust/uuid/src/adapter/compact.rs => third_party/rust/uuid-0.7.4/src/adapter/compact.rs rename : third_party/rust/uuid/src/adapter/core_support/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/core_support/mod.rs rename : third_party/rust/uuid/src/adapter/mod.rs => third_party/rust/uuid-0.7.4/src/adapter/mod.rs rename : third_party/rust/uuid/src/builder.rs => third_party/rust/uuid-0.7.4/src/builder.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.7.4/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.7.4/src/lib.rs rename : third_party/rust/uuid/src/parser/core_support.rs => third_party/rust/uuid-0.7.4/src/parser/core_support.rs rename : third_party/rust/uuid/src/parser/mod.rs => third_party/rust/uuid-0.7.4/src/parser/mod.rs rename : third_party/rust/uuid/src/parser/std_support.rs => third_party/rust/uuid-0.7.4/src/parser/std_support.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.7.4/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.7.4/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.7.4/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.7.4/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.7.4/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.7.4/src/u128_support.rs rename : third_party/rust/uuid/src/v1.rs => third_party/rust/uuid-0.7.4/src/v1.rs rename : third_party/rust/uuid/src/v3.rs => third_party/rust/uuid-0.7.4/src/v3.rs rename : third_party/rust/uuid/src/v4.rs => third_party/rust/uuid-0.7.4/src/v4.rs rename : third_party/rust/uuid/src/v5.rs => third_party/rust/uuid-0.7.4/src/v5.rs rename : third_party/rust/uuid/src/winapi_support.rs => third_party/rust/uuid-0.7.4/src/winapi_support.rs extra : moz-landing-system : lando
2019-12-06 03:33:03 +03:00
[`Uuid`]: https://docs.rs/uuid/0.8.1/uuid/struct.Uuid.html
---
# License
Licensed under either of
* Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
* MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.