Skip to main content

NotesError

Enum NotesError 

Source
#[non_exhaustive]
pub enum NotesError { AlreadyExists { object: ObjectId, }, InvalidRef { name: String, }, UnknownRewriteMode { mode: String, }, RefNotCommit { notes_ref: String, found: ObjectKind, }, UnexpectedObjectKind { oid: ObjectId, expected: ObjectKind, found: ObjectKind, }, MergeBothEmpty { local: String, remote: String, }, MergeInProgress { path: PathBuf, }, }
Expand description

Notes failure: notes refs, the notes tree layout, rewrite configuration, and notes merges.

Surfaced on the umbrella as Error::Notes.

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.
§

AlreadyExists

RepositoryNotes::add was called without force when a note already exists on the object.

Fields

§object: ObjectId

Annotated object that already has a note.

§

InvalidRef

A configured or environment notes ref is not under refs/notes/.

Fields

§name: String

The notes ref as configured.

§

UnknownRewriteMode

Unknown notes.rewriteMode or GIT_NOTES_REWRITE_MODE value.

Fields

§mode: String

The rewrite mode as configured.

§

RefNotCommit

A notes ref resolves to an object that cannot hold notes (notes reads accept a commit or a tree; notes merges require a commit).

Fields

§notes_ref: String

Notes ref (or revision) that was read.

§found: ObjectKind

Kind of object the ref resolved to.

§

UnexpectedObjectKind

An object reached while reading a notes tree has the wrong kind (for example a note entry that is not a blob).

Fields

§oid: ObjectId

Object that was read.

§expected: ObjectKind

Kind the notes layout requires at this position.

§found: ObjectKind

Kind actually stored.

§

MergeBothEmpty

notes_merge_inner was asked to merge two notes refs that both have no notes commit.

Fields

§local: String

Local notes ref (merge destination).

§remote: String

Remote notes ref (merge source).

§

MergeInProgress

A manual notes merge was started while an earlier one still has conflict files in the notes merge worktree.

Fields

§path: PathBuf

The notes merge worktree directory.

Implementations§

Source§

impl NotesError

Source

pub fn kind_name(&self) -> &'static str

Stable snake_case slug for this failure (the former umbrella variant names).

Trait Implementations§

Source§

impl Debug for NotesError

Source§

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

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

impl Display for NotesError

Source§

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

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

impl Error for NotesError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<NotesError> for Error

Source§

fn from(source: NotesError) -> Self

Converts to this type from the input type.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.