pub struct MemoryTree(pub PyObject);Expand description
An in-memory tree implementation.
Tuple Fields§
§0: PyObjectTrait Implementations§
Source§impl<'py> IntoPyObject<'py> for MemoryTree
impl<'py> IntoPyObject<'py> for MemoryTree
Source§type Output = Bound<'py, <MemoryTree as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <MemoryTree as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a conversion error.
Source§impl PyTree for MemoryTree
impl PyTree for MemoryTree
impl PyMutableTree for MemoryTree
Auto Trait Implementations§
impl Freeze for MemoryTree
impl !RefUnwindSafe for MemoryTree
impl Send for MemoryTree
impl Sync for MemoryTree
impl Unpin for MemoryTree
impl UnwindSafe for MemoryTree
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.Source§impl<T> MutableTree for Twhere
T: PyMutableTree + ?Sized,
impl<T> MutableTree for Twhere
T: PyMutableTree + ?Sized,
Source§fn put_file_bytes_non_atomic(
&self,
path: &Path,
data: &[u8],
) -> Result<(), Error>
fn put_file_bytes_non_atomic( &self, path: &Path, data: &[u8], ) -> Result<(), Error>
Write bytes to a file in the tree without atomic guarantees.
Source§fn remove(&self, files: &[&Path]) -> Result<(), Error>
fn remove(&self, files: &[&Path]) -> Result<(), Error>
Remove specified files from version control and from the filesystem.
Source§fn add_reference(&self, reference: &TreeReference) -> Result<(), Error>
fn add_reference(&self, reference: &TreeReference) -> Result<(), Error>
Add a tree reference.
Source§fn copy_one(&self, from_path: &Path, to_path: &Path) -> Result<(), Error>
fn copy_one(&self, from_path: &Path, to_path: &Path) -> Result<(), Error>
Copy a file or directory to a new location.
Source§fn last_revision(&self) -> Result<RevisionId, Error>
fn last_revision(&self) -> Result<RevisionId, Error>
Get the last revision ID.
Source§fn set_parent_ids(&self, parent_ids: &[RevisionId]) -> Result<(), Error>
fn set_parent_ids(&self, parent_ids: &[RevisionId]) -> Result<(), Error>
Set the parent IDs for this tree.
Source§fn set_parent_trees(
&self,
parent_trees: &[(RevisionId, RevisionTree)],
) -> Result<(), Error>
fn set_parent_trees( &self, parent_trees: &[(RevisionId, RevisionTree)], ) -> Result<(), Error>
Set the parent trees for this tree.
Source§fn apply_inventory_delta(&self, delta: Vec<InventoryDelta>) -> Result<(), Error>
fn apply_inventory_delta(&self, delta: Vec<InventoryDelta>) -> Result<(), Error>
Apply a delta to the tree.
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> Tree for T
impl<T> Tree for T
Source§fn get_tag_dict(&self) -> Result<HashMap<String, RevisionId>, Error>
fn get_tag_dict(&self) -> Result<HashMap<String, RevisionId>, Error>
Get a dictionary of tags and their revision IDs.
Source§fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
Get a file from the tree as a readable stream.
Source§fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
Get the contents of a file from the tree as a byte vector.
Source§fn get_file_lines(&self, path: &Path) -> Result<Vec<Vec<u8>>, Error>
fn get_file_lines(&self, path: &Path) -> Result<Vec<Vec<u8>>, Error>
Get the contents of a file as a vector of lines (byte vectors).
Source§fn has_filename(&self, path: &Path) -> bool
fn has_filename(&self, path: &Path) -> bool
Check if a file exists in the tree at the specified path.
Source§fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
Get the target of a symbolic link.
Source§fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
Get the IDs of the parent revisions of this tree.
Source§fn is_ignored(&self, path: &Path) -> Option<String>
fn is_ignored(&self, path: &Path) -> Option<String>
Check if a path is ignored by version control.
Source§fn kind(&self, path: &Path) -> Result<Kind, Error>
fn kind(&self, path: &Path) -> Result<Kind, Error>
Get the kind of object at the specified path (file, directory, symlink, etc.).
Source§fn is_versioned(&self, path: &Path) -> bool
fn is_versioned(&self, path: &Path) -> bool
Check if a path is under version control.
Source§fn iter_changes(
&self,
other: &(dyn PyTree + 'static),
specific_files: Option<&[&Path]>,
want_unversioned: Option<bool>,
require_versioned: Option<bool>,
) -> Result<Box<dyn Iterator<Item = Result<TreeChange, Error>>>, Error>
fn iter_changes( &self, other: &(dyn PyTree + 'static), specific_files: Option<&[&Path]>, want_unversioned: Option<bool>, require_versioned: Option<bool>, ) -> Result<Box<dyn Iterator<Item = Result<TreeChange, Error>>>, Error>
Iterate through the changes between this tree and another tree. Read more
Source§fn has_versioned_directories(&self) -> bool
fn has_versioned_directories(&self) -> bool
Check if this tree supports versioned directories.
Source§fn preview_transform(&self) -> Result<TreeTransform, Error>
fn preview_transform(&self) -> Result<TreeTransform, Error>
Get a preview of transformations that would be applied to this tree.
Source§fn list_files(
&self,
include_root: Option<bool>,
from_dir: Option<&Path>,
recursive: Option<bool>,
recurse_nested: Option<bool>,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, bool, Kind, TreeEntry), Error>>>, Error>
fn list_files( &self, include_root: Option<bool>, from_dir: Option<&Path>, recursive: Option<bool>, recurse_nested: Option<bool>, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, bool, Kind, TreeEntry), Error>>>, Error>
List files in the tree, optionally recursively. Read more
Source§fn iter_child_entries(
&self,
path: &Path,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Kind, TreeEntry), Error>>>, Error>
fn iter_child_entries( &self, path: &Path, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Kind, TreeEntry), Error>>>, Error>
Iterate through entries in a directory. Read more
Source§fn get_file_sha1(
&self,
path: &Path,
_stat_value: Option<&Metadata>,
) -> Result<String, Error>
fn get_file_sha1( &self, path: &Path, _stat_value: Option<&Metadata>, ) -> Result<String, Error>
Get the SHA1 hash of a file’s contents.
Source§fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
Get the modification time of a file.
Source§fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
Get the stored kind of a file (as opposed to the actual kind on disk).
Source§fn supports_content_filtering(&self) -> bool
fn supports_content_filtering(&self) -> bool
Check if the tree supports content filtering.
Source§fn supports_file_ids(&self) -> bool
fn supports_file_ids(&self) -> bool
Check if the tree supports file IDs.
Source§fn supports_rename_tracking(&self) -> bool
fn supports_rename_tracking(&self) -> bool
Check if the tree supports rename tracking.
Source§fn supports_symlinks(&self) -> bool
fn supports_symlinks(&self) -> bool
Check if the tree supports symbolic links.
Source§fn supports_tree_reference(&self) -> bool
fn supports_tree_reference(&self) -> bool
Check if the tree supports tree references.
Source§fn all_versioned_paths(
&self,
) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>
fn all_versioned_paths( &self, ) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>
Get all versioned paths in the tree.
Source§fn filter_unversioned_files(
&self,
paths: &[&Path],
) -> Result<Vec<PathBuf>, Error>
fn filter_unversioned_files( &self, paths: &[&Path], ) -> Result<Vec<PathBuf>, Error>
Filter out versioned files from a list of paths.
Source§fn walkdirs(
&self,
prefix: Option<&Path>,
) -> Result<Box<dyn Iterator<Item = Result<WalkdirResult, Error>>>, Error>
fn walkdirs( &self, prefix: Option<&Path>, ) -> Result<Box<dyn Iterator<Item = Result<WalkdirResult, Error>>>, Error>
Walk directories in the tree.
Source§fn versionable_kind(&self, kind: &Kind) -> bool
fn versionable_kind(&self, kind: &Kind) -> bool
Check if a file kind is versionable.
Source§fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
Get file content summary for a path.
Source§fn iter_files_bytes(
&self,
paths: &[&Path],
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Vec<u8>), Error>>>, Error>
fn iter_files_bytes( &self, paths: &[&Path], ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Vec<u8>), Error>>>, Error>
Iterate through file bytes.
Source§fn iter_entries_by_dir(
&self,
specific_files: Option<&[&Path]>,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, TreeEntry), Error>>>, Error>
fn iter_entries_by_dir( &self, specific_files: Option<&[&Path]>, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, TreeEntry), Error>>>, Error>
Iterate through entries by directory.
Source§fn get_file_verifier(
&self,
path: &Path,
_stat_value: Option<&Metadata>,
) -> Result<(String, Vec<u8>), Error>
fn get_file_verifier( &self, path: &Path, _stat_value: Option<&Metadata>, ) -> Result<(String, Vec<u8>), Error>
Get file verifier information.
Source§fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
Get the reference revision for a tree reference.
Source§fn archive(
&self,
format: &str,
name: &str,
root: Option<&str>,
subdir: Option<&Path>,
force_mtime: Option<f64>,
recurse_nested: bool,
) -> Result<Box<dyn Iterator<Item = Result<Vec<u8>, Error>>>, Error>
fn archive( &self, format: &str, name: &str, root: Option<&str>, subdir: Option<&Path>, force_mtime: Option<f64>, recurse_nested: bool, ) -> Result<Box<dyn Iterator<Item = Result<Vec<u8>, Error>>>, Error>
Create an archive of the tree.
Source§fn annotate_iter(
&self,
path: &Path,
default_revision: Option<&RevisionId>,
) -> Result<Box<dyn Iterator<Item = Result<(RevisionId, Vec<u8>), Error>>>, Error>
fn annotate_iter( &self, path: &Path, default_revision: Option<&RevisionId>, ) -> Result<Box<dyn Iterator<Item = Result<(RevisionId, Vec<u8>), Error>>>, Error>
Annotate a file with revision information.
Source§fn is_special_path(&self, path: &Path) -> bool
fn is_special_path(&self, path: &Path) -> bool
Check if a path is a special path (e.g., control directory).