Struct git_record::FileState
source · [−]Expand description
The state of a file to be recorded.
Fields
file_mode: Option<usize>The Unix file mode of the file, if available.
This value is not directly modified by the UI; instead, construct a
Section::FileMode and use the FileState::get_file_mode function
to read a user-provided updated to the file mode function to read a
user-provided updated to the file mode
sections: Vec<Section<'a>>The set of Sections inside the file.
Implementations
sourceimpl FileState<'_>
impl FileState<'_>
sourcepub fn count_changed_sections(&self) -> usize
pub fn count_changed_sections(&self) -> usize
Count the number of changed sections in this file.
sourcepub fn get_file_mode(&self) -> Option<usize>
pub fn get_file_mode(&self) -> Option<usize>
Get the new Unix file mode. If the user selected a
Section::FileMode, then returns that file mode. Otherwise, returns
the file_mode value that this FileState was constructed with.
sourcepub fn get_selected_contents(&self) -> (String, String)
pub fn get_selected_contents(&self) -> (String, String)
Calculate the (selected, unselected) contents of the file. For
example, the first value would be suitable for staging or committing,
and the second value would be suitable for potentially recording again.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for FileState<'a>
impl<'a> Send for FileState<'a>
impl<'a> Sync for FileState<'a>
impl<'a> Unpin for FileState<'a>
impl<'a> UnwindSafe for FileState<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> With for T
impl<T> With for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more