Skip to main content

RepoEvent

Enum RepoEvent 

Source
#[non_exhaustive]
pub enum RepoEvent { HeadMoved { from: Option<String>, to: Option<String>, }, BranchSwitched { from: Option<String>, to: Option<String>, }, BranchCreated { name: String, }, BranchDeleted { name: String, }, WorkingCopyChanged { dirty: bool, change_count: usize, }, UpstreamChanged { upstream: Option<String>, }, AheadBehindChanged { ahead: Option<usize>, behind: Option<usize>, }, OperationChanged { from: OperationState, to: OperationState, }, ConflictChanged { conflicted: bool, }, }
Expand description

One typed change to a repository’s observable state, derived by diffing two consecutive RepoSnapshots (plus the branch set).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

HeadMoved

The working-copy commit moved (a commit, checkout, reset, jj op, …). from/to are the full object ids; None on an unborn git repo.

Fields

§from: Option<String>

The previous HEAD/@ object id.

§to: Option<String>

The new HEAD/@ object id.

§

BranchSwitched

The current branch (git) / bookmark (jj) changed — a switch/checkout, or going (in)to a detached/unset state (None).

Fields

§from: Option<String>

The previously checked-out branch/bookmark.

§to: Option<String>

The newly checked-out branch/bookmark.

§

BranchCreated

A local branch/bookmark appeared.

Fields

§name: String

The new branch/bookmark name.

§

BranchDeleted

A local branch/bookmark was removed.

Fields

§name: String

The removed branch/bookmark name.

§

WorkingCopyChanged

The working-copy dirtiness or change count changed (an edit was staged, committed, stashed, snapshotted, …).

Fields

§dirty: bool

Whether the working copy now has uncommitted changes.

§change_count: usize

The new count of changed paths.

§

UpstreamChanged

The upstream tracking branch changed (git only; always absent on jj).

Fields

§upstream: Option<String>

The new upstream tracking branch, or None when unset.

§

AheadBehindChanged

The ahead/behind counts versus the upstream changed (git only).

Fields

§ahead: Option<usize>

Commits ahead of the upstream now, or None with no upstream.

§behind: Option<usize>

Commits behind the upstream now, or None with no upstream.

§

OperationChanged

The in-progress operation changed — a git merge or rebase started or finished. A transition to/from OperationState::Conflict (jj’s conflict marker) is not reported here: vcs-core derives jj’s operation and conflicted from the same bit, so ConflictChanged already signals it on both backends. So this event fires only on git, and from/to are Clear/Merge/Rebase.

Fields

§from: OperationState

The previous operation state.

§to: OperationState

The new operation state.

§

ConflictChanged

Whether the working copy has an unresolved conflict changed.

Fields

§conflicted: bool

Whether the working copy is now conflicted.

Trait Implementations§

Source§

impl Clone for RepoEvent

Source§

fn clone(&self) -> RepoEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepoEvent

Source§

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

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

impl Eq for RepoEvent

Source§

impl PartialEq for RepoEvent

Source§

fn eq(&self, other: &RepoEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RepoEvent

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more