no function or associated item named new_v3 found for struct uuid::Uuid in the current scope

Viewed 1738

I need to add uuid in one of my struct. I found one crate for uuid support. I added the dependency to my Cargo.toml

uuid = "0.8.1"

It downloaded fine but I can't use the function Uuid::new_v3(). I get the error: no function or associated item named new_v3 found for struct uuid::Uuid in the current scope.

The weird part for me is that I can use some of them like from_slice works fine.

1 Answers

You have to explicitly specify uuid's features you're planing to use.

You can add new_v3 support by adding v3 feature like this:

uuid = { version = "0.8", features = ["v3"] }

More info can be found there

Related