pub struct LoopGuard { /* private fields */ }Expand description
A loop guard whose files live in one directory.
Implementations§
Source§impl LoopGuard
impl LoopGuard
Sourcepub fn new(dir: impl Into<PathBuf>) -> Self
pub fn new(dir: impl Into<PathBuf>) -> Self
A guard keeping its files in dir, created on the first write with a
.gitignore of * so a directory inside a repository stays out of
it.
Sourcepub fn should_block(&self, key: &str, text: &str) -> bool
pub fn should_block(&self, key: &str, text: &str) -> bool
Whether the hook should block on text for key: false when it
blocked on the same text last time; otherwise true, and the text’s
hash is recorded.
Trait Implementations§
impl Eq for LoopGuard
impl StructuralPartialEq for LoopGuard
Auto Trait Implementations§
impl Freeze for LoopGuard
impl RefUnwindSafe for LoopGuard
impl Send for LoopGuard
impl Sync for LoopGuard
impl Unpin for LoopGuard
impl UnsafeUnpin for LoopGuard
impl UnwindSafe for LoopGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.