| Crates.io | tlrepo |
| lib.rs | tlrepo |
| version | 0.8.0 |
| created_at | 2020-08-25 04:58:45.068546+00 |
| updated_at | 2025-01-26 08:52:53.005179+00 |
| description | Thread-local git2::Repository, shareable across threads |
| homepage | |
| repository | https://github.com/joshtriplett/tlrepo |
| max_upload_size | |
| id | 280376 |
| size | 16,990 |
tlrepo provides ThreadLocalRepo, a convenient way to share a
git2::Repository object between threads.
A standard git2::Repository object does not support sharing among threads
without some form of synchronization. tlrepo::ThreadLocalRepo provides a
convenient way to reopen the same repository on each thread, caching the opened
repository thread-locally for reuse.
You can create a ThreadLocalRepo by calling ThreadLocalRepo::new, or by
using the extension trait tlrepo::RepositoryExt to call .thread_local() on
an existing git2::Repository. You can share the ThreadLocalRepo across
threads, calling .get() to get a git2::Repository object to work with.