Skip to main content

Notes

Struct Notes 

Source
pub struct Notes { /* private fields */ }
Expand description

The notes under refs/notes/NAME of one repository.

Implementations§

Source§

impl Notes

Source

pub fn new(git: Git, name: &str) -> Self

Source

pub fn append(&self, commit: &str, lines: &[String]) -> Result<(), Error>

Adds lines to the note on commit, keeping what it holds.

Source

pub fn along(&self, rev: &str, depth: usize) -> Vec<(String, Vec<String>)>

The notes on rev and its first-parent ancestors, newest first, up to depth commits back: each commit that has a note, with its lines.

Source

pub fn fetch(&self, remote: &str) -> Result<bool, Error>

Fetches remote’s notes and merges them into the local ones. Ok(false) when the remote has none; an error when it cannot be reached or read.

Source

pub fn push(&self, remote: &str) -> Result<(), Error>

Pushes the notes to remote, merging in what another writer pushed first, and never forcing.

Auto Trait Implementations§

§

impl Forget for Notes

§

impl Freeze for Notes

§

impl Move for Notes

§

impl RefUnwindSafe for Notes

§

impl Send for Notes

§

impl Sync for Notes

§

impl Unpin for Notes

§

impl UnsafeUnpin for Notes

§

impl UnwindSafe for Notes

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 = !

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.