Skip to main content

Hooks

Struct Hooks 

Source
pub struct Hooks {
Show 28 fields pub applypatch_msg: Option<HookConfig>, pub pre_applypatch: Option<HookConfig>, pub post_applypatch: Option<HookConfig>, pub pre_commit: Option<HookConfig>, pub pre_merge_commit: Option<HookConfig>, pub prepare_commit_msg: Option<HookConfig>, pub commit_msg: Option<HookConfig>, pub post_commit: Option<HookConfig>, pub pre_rebase: Option<HookConfig>, pub post_checkout: Option<HookConfig>, pub post_merge: Option<HookConfig>, pub pre_push: Option<HookConfig>, pub pre_receive: Option<HookConfig>, pub update: Option<HookConfig>, pub proc_receive: Option<HookConfig>, pub post_receive: Option<HookConfig>, pub post_update: Option<HookConfig>, pub reference_transaction: Option<HookConfig>, pub push_to_checkout: Option<HookConfig>, pub pre_auto_gc: Option<HookConfig>, pub post_rewrite: Option<HookConfig>, pub sendemail_validate: Option<HookConfig>, pub fsmonitor_watchman: Option<HookConfig>, pub p4_changelist: Option<HookConfig>, pub p4_prepare_changelist: Option<HookConfig>, pub p4_post_changelist: Option<HookConfig>, pub p4_pre_submit: Option<HookConfig>, pub post_index_change: Option<HookConfig>,
}
Expand description

All supported git hooks. Configure any hook by adding its name as a key.

Fields§

§applypatch_msg: Option<HookConfig>§pre_applypatch: Option<HookConfig>§post_applypatch: Option<HookConfig>§pre_commit: Option<HookConfig>§pre_merge_commit: Option<HookConfig>§prepare_commit_msg: Option<HookConfig>§commit_msg: Option<HookConfig>§post_commit: Option<HookConfig>§pre_rebase: Option<HookConfig>§post_checkout: Option<HookConfig>§post_merge: Option<HookConfig>§pre_push: Option<HookConfig>§pre_receive: Option<HookConfig>§update: Option<HookConfig>§proc_receive: Option<HookConfig>§post_receive: Option<HookConfig>§post_update: Option<HookConfig>§reference_transaction: Option<HookConfig>§push_to_checkout: Option<HookConfig>§pre_auto_gc: Option<HookConfig>§post_rewrite: Option<HookConfig>§sendemail_validate: Option<HookConfig>§fsmonitor_watchman: Option<HookConfig>§p4_changelist: Option<HookConfig>§p4_prepare_changelist: Option<HookConfig>§p4_post_changelist: Option<HookConfig>§p4_pre_submit: Option<HookConfig>§post_index_change: Option<HookConfig>

Implementations§

Source§

impl Hooks

Source

pub fn get(&self, name: &str) -> Option<&HookConfig>

Get a hook config by its git hook name (e.g. “pre-commit”).

Source

pub fn set(&mut self, name: &str, cfg: HookConfig)

Set a hook config by its git hook name.

Source

pub fn remove(&mut self, name: &str)

Remove a hook from the config by its git hook name.

Trait Implementations§

Source§

impl Debug for Hooks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Hooks

Source§

fn default() -> Hooks

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Hooks

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Hooks

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Hooks

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Hooks

§

impl RefUnwindSafe for Hooks

§

impl Send for Hooks

§

impl Sync for Hooks

§

impl Unpin for Hooks

§

impl UnsafeUnpin for Hooks

§

impl UnwindSafe for Hooks

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,