pub struct Note {
pub path: String,
pub side: NoteSide,
pub line: usize,
pub code: String,
pub text: String,
pub review: Option<String>,
pub draft: bool,
}Expand description
A reviewer’s note on one line of a change, or — with an empty path — on the change as a whole.
Fields§
§path: String§side: NoteSide§line: usize§code: StringThe line the note is about, so the note still makes sense once lines move.
text: String§review: Option<String>The review the note was left in — a pull request, or a range such as
origin/main...feature — so it only shows up, and is only posted, there.
draft: boolAdded from outside the viewer (declutter notes add) and not yet opened by the
reviewer. Drafts are never posted: opening one with m makes it the reviewer’s.
Implementations§
Source§impl Note
impl Note
Sourcepub fn on_pull_request(text: impl Into<String>) -> Note
pub fn on_pull_request(text: impl Into<String>) -> Note
A draft note on the change as a whole rather than on a line.
Sourcepub fn on_line(
files: &[FileReview],
path: &str,
side: NoteSide,
line: usize,
text: impl Into<String>,
) -> Result<Note>
pub fn on_line( files: &[FileReview], path: &str, side: NoteSide, line: usize, text: impl Into<String>, ) -> Result<Note>
A draft note on line of path, which must be a row of the change’s diff —
with every layer shown — since that is where the viewer can show it. A removed
line is on the old side; added and unchanged lines are on the new side.
pub fn is_general(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Note
impl<'de> Deserialize<'de> for Note
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Note
impl StructuralPartialEq for Note
Auto Trait Implementations§
impl Freeze for Note
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnsafeUnpin for Note
impl UnwindSafe for Note
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more