pub struct PushGuard { /* private fields */ }Expand description
The in-process checks every push these handlers serve gets.
A repository with snapshot checkouts refuses pushes that create, update or
delete its target branch (TargetGuard), and tells the pusher how its
work reaches the target instead. A repository without checkouts keeps
Git’s rules.
Implementations§
Trait Implementations§
Source§impl ReceiveHook for PushGuard
impl ReceiveHook for PushGuard
Source§fn update(
&self,
command: &RefCommand,
odb: &Odb,
) -> Result<(), RefUpdateRefusal>
fn update( &self, command: &RefCommand, odb: &Odb, ) -> Result<(), RefUpdateRefusal>
Inspect one update, like an
update hook. Read moreSource§fn message(&self, updates: &[RefUpdateResult]) -> Option<String>
fn message(&self, updates: &[RefUpdateResult]) -> Option<String>
What to tell the pushing client once every update has been decided,
as a hook script’s output would: Git clients show each line as
remote: <line>. Read moreSource§fn pre_receive(
&self,
commands: &[RefCommand],
odb: &Odb,
) -> Result<(), RefUpdateRefusal>
fn pre_receive( &self, commands: &[RefCommand], odb: &Odb, ) -> Result<(), RefUpdateRefusal>
Inspect the whole push before any ref changes, like a
pre-receive hook. Read moreSource§fn pre_receive_ctx(
&self,
commands: &[RefCommand],
odb: &Odb,
ctx: &ReceiveHookContext<'_>,
) -> Result<(), RefUpdateRefusal>
fn pre_receive_ctx( &self, commands: &[RefCommand], odb: &Odb, ctx: &ReceiveHookContext<'_>, ) -> Result<(), RefUpdateRefusal>
Like
Self::pre_receive, with push options from the client request.Source§fn update_ctx(
&self,
command: &RefCommand,
odb: &Odb,
ctx: &ReceiveHookContext<'_>,
) -> Result<(), RefUpdateRefusal>
fn update_ctx( &self, command: &RefCommand, odb: &Odb, ctx: &ReceiveHookContext<'_>, ) -> Result<(), RefUpdateRefusal>
Like
Self::update, with push options from the client request.Source§fn post_receive(
&self,
commands: &[&RefCommand],
odb: &Odb,
ctx: &ReceiveHookContext<'_>,
) -> Result<(), RefUpdateRefusal>
fn post_receive( &self, commands: &[&RefCommand], odb: &Odb, ctx: &ReceiveHookContext<'_>, ) -> Result<(), RefUpdateRefusal>
Run after refs were updated and the
post-receive script, like a
post-receive hook for in-process policy and audit. Read moreSource§fn post_update(
&self,
commands: &[&RefCommand],
odb: &Odb,
) -> Result<(), RefUpdateRefusal>
fn post_update( &self, commands: &[&RefCommand], odb: &Odb, ) -> Result<(), RefUpdateRefusal>
Run after the
post-update script for the same applied updates. Read moreAuto Trait Implementations§
impl Forget for PushGuard
impl Freeze for PushGuard
impl RefUnwindSafe for PushGuard
impl Send for PushGuard
impl Sync for PushGuard
impl Unpin for PushGuard
impl UnsafeUnpin for PushGuard
impl UnwindSafe for PushGuard
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