pub struct FileChange {
pub file_path: String,
pub symbol_name: Option<String>,
pub line: usize,
pub annotations: Vec<Suggestion>,
pub existing_doc_start: Option<usize>,
pub existing_doc_end: Option<usize>,
}Expand description
@acp:summary “A planned change to apply to a file”
Fields§
§file_path: StringPath to the file
symbol_name: Option<String>Symbol name (None for file-level)
line: usizeLine number where to insert (1-indexed)
annotations: Vec<Suggestion>Annotations to add
existing_doc_start: Option<usize>Start line of existing doc comment (if any)
existing_doc_end: Option<usize>End line of existing doc comment (if any)
Implementations§
Source§impl FileChange
impl FileChange
Sourcepub fn new(file_path: impl Into<String>, line: usize) -> Self
pub fn new(file_path: impl Into<String>, line: usize) -> Self
@acp:summary “Creates a new file change”
Sourcepub fn with_symbol(self, name: impl Into<String>) -> Self
pub fn with_symbol(self, name: impl Into<String>) -> Self
@acp:summary “Sets the symbol name”
Sourcepub fn with_existing_doc(self, start: usize, end: usize) -> Self
pub fn with_existing_doc(self, start: usize, end: usize) -> Self
@acp:summary “Sets the existing doc comment range”
Sourcepub fn add_annotation(&mut self, suggestion: Suggestion)
pub fn add_annotation(&mut self, suggestion: Suggestion)
@acp:summary “Adds an annotation to this change”
Trait Implementations§
Source§impl Clone for FileChange
impl Clone for FileChange
Source§fn clone(&self) -> FileChange
fn clone(&self) -> FileChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileChange
impl Debug for FileChange
Source§impl<'de> Deserialize<'de> for FileChange
impl<'de> Deserialize<'de> for FileChange
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
Auto Trait Implementations§
impl Freeze for FileChange
impl RefUnwindSafe for FileChange
impl Send for FileChange
impl Sync for FileChange
impl Unpin for FileChange
impl UnwindSafe for FileChange
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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