[−][src]Struct tlrepo::ThreadLocalRepo
An object providing a thread-local copy of a git2::Repository
for each thread.
Implementations
impl ThreadLocalRepo
[src]
pub fn new(path: PathBuf) -> Self
[src]
Create a ThreadLocalRepo
that opens the repository at the specified path on each thread.
pub fn get(&self) -> Result<&Repository, Error>
[src]
Get the git2::Repository
for this thread. Returns an error if the open fails.
Note that the cache of thread-local objects never gets pruned. If you're running on a
long-running thread or a thread pool, call this method. If you're running on a short-lived
thread, call get_uncached
instead.
pub fn get_uncached(&self) -> Result<Repository, Error>
[src]
Get a new git2::Repository
, and don't save it in the thread-local cache. Returns an error
if the open fails.
The cache of thread-local objects never gets pruned. If, over the lifetime of your process,
you run an unbounded number of threads that call get
and subsequently exit, the
thread-local cache will grow without bound. In such threads, use get_uncached
to open a
repository that won't get cached.
Auto Trait Implementations
impl RefUnwindSafe for ThreadLocalRepo
impl Send for ThreadLocalRepo
impl Sync for ThreadLocalRepo
impl Unpin for ThreadLocalRepo
impl UnwindSafe for ThreadLocalRepo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,