How to use external libraries not included in crates.io

Hi, I am very new to rust, so sorry if this question is trivial. I wanted to know, if I want to use a library which is not necessarily part of the standard crates available in rust, for instance arkworks/pcd. I want to know how to use it for my code and even more it is not very clear to me from the documentation how it can be used for operations on images. Can someone help me in this regard. I will be extremely grateful.

Thanks !

Where is the library you want to use hosted? If it's in a Git repository somewhere you can use that as a dependency in your Cargo.toml.

3 Likes

So I want to use this library in my own example so essentially I created something like cargo new my-example. Now I want to use this library in actually verification of image. After some googling I got a suggestion that I can use this library but I have no other reference how to use it in my folder my-example and what functionality of it I can use. Here is the link for github repository "GitHub - arkworks-rs/pcd: Implementations of proof-carrying data"

It looks like that library has not been published to crates.io, so you will have to use it as a Git dependency, by putting this line under [dependencies] in your project's Cargo.toml:

ark-pcd = { git = "https://github.com/arkworks-rs/pcd" }
2 Likes

Oh I see, thanks a lot. I will try with that.

It works, thanks, I can also see different functionalities I have from there too.

Thanks

1 Like

Its also possible to specify deps by file path:

hello_utils = { path = "hello_utils" }

For further information on this take a look at: Specifying Dependencies - The Cargo Book

1 Like

Thanks for now it works, if needed I will try it.