pub struct Session {
pub files: Vec<FileEntry>,
pub current: usize,
pub written: Vec<bool>,
pub op_label: String,
pub folded: bool,
}Expand description
多文件冲突解决会话。
Fields§
§files: Vec<FileEntry>全部待解决文件
current: usize当前文件下标
written: Vec<bool>各文件是否已写盘
op_label: String状态条展示的操作名(如 “merge” / “rebase” / 文件名)
folded: bool是否折叠长稳定区(z 切换)
Implementations§
Source§impl Session
impl Session
Sourcepub fn current_file(&self) -> &FileEntry
pub fn current_file(&self) -> &FileEntry
当前文件。
Sourcepub fn current_file_mut(&mut self) -> &mut FileEntry
pub fn current_file_mut(&mut self) -> &mut FileEntry
当前文件(可变)。
Sourcepub fn mark_written(&mut self)
pub fn mark_written(&mut self)
标记当前文件已写盘,并把光标移到下一个未写盘文件(若有)。
Sourcepub fn all_written(&self) -> bool
pub fn all_written(&self) -> bool
是否所有文件都已写盘。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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> 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