pub(crate) struct Repository {
git: Repository,
}Fields§
§git: RepositoryImplementations§
Source§impl Repository
impl Repository
pub(crate) fn open(root: &Path) -> Result<Self, FilesError>
Sourcefn stat(
root: &Path,
path: &RepositoryPath,
) -> Result<Option<(PathBuf, Metadata)>, FilesError>
fn stat( root: &Path, path: &RepositoryPath, ) -> Result<Option<(PathBuf, Metadata)>, FilesError>
The full path and metadata of path below root, or None when
nothing exists there. A symlink in a parent directory is an error.
pub(crate) fn current_entry( root: &Path, path: &RepositoryPath, ) -> Result<Option<FileEntry>, FilesError>
Sourcepub(crate) fn tracked(&self) -> Result<BTreeSet<RepositoryPath>, FilesError>
pub(crate) fn tracked(&self) -> Result<BTreeSet<RepositoryPath>, FilesError>
Paths tracked in the index.
Untracked files are never discovered.
Sourcepub(crate) fn leading_bytes(
root: &Path,
path: &RepositoryPath,
) -> Result<Option<Vec<u8>>, FilesError>
pub(crate) fn leading_bytes( root: &Path, path: &RepositoryPath, ) -> Result<Option<Vec<u8>>, FilesError>
The first bytes of the file at path, empty for anything that is not
a regular file, or None when nothing exists there.
Sourcepub(crate) fn visible_files(
&self,
) -> Result<BTreeSet<RepositoryPath>, FilesError>
pub(crate) fn visible_files( &self, ) -> Result<BTreeSet<RepositoryPath>, FilesError>
Regular files that are tracked or untracked and not ignored.
pub(crate) fn stage(&self, operations: &[Operation]) -> Result<(), FilesError>
pub(crate) fn ensure_recoverable( &self, path: &RepositoryPath, current: &FileEntry, ) -> Result<(), FilesError>
pub(crate) fn is_recoverable( &self, path: &RepositoryPath, current: &FileEntry, ) -> bool
Sourcefn decode_path(bytes: &[u8]) -> Result<RepositoryPath, PathError>
fn decode_path(bytes: &[u8]) -> Result<RepositoryPath, PathError>
Decode a Git-reported path, rejecting non-UTF-8 bytes the same way
RepositoryPath::try_from rejects a structurally invalid path.
Auto Trait Implementations§
impl !Sync for Repository
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Unpin for Repository
impl UnsafeUnpin for Repository
impl UnwindSafe for Repository
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