MemoryTree

Struct MemoryTree 

Source
pub struct MemoryTree(pub PyObject);
Expand description

An in-memory tree implementation.

Tuple Fields§

§0: PyObject

Trait Implementations§

Source§

impl<B: PyBranch> From<&B> for MemoryTree

Source§

fn from(branch: &B) -> Self

Converts to this type from the input type.
Source§

impl<'py> IntoPyObject<'py> for MemoryTree

Source§

type Target = PyAny

The Python output type
Source§

type Output = Bound<'py, <MemoryTree as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Performs the conversion.
Source§

impl PyTree for MemoryTree

Source§

fn to_object(&self, py: Python<'_>) -> PyObject

Get the underlying Python object for this tree.
Source§

impl PyMutableTree for MemoryTree

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Source§

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§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Source§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
Source§

impl<T> MutableTree for T
where T: PyMutableTree + ?Sized,

Source§

fn add(&self, files: &[&Path]) -> Result<(), Error>

Add specified files to version control.
Source§

fn lock_write(&self) -> Result<Lock, Error>

Lock the tree for write operations.
Source§

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 has_changes(&self) -> Result<bool, Error>

Check if the tree has any uncommitted changes.
Source§

fn mkdir(&self, path: &Path) -> Result<(), Error>

Create a directory in the tree.
Source§

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>

Add a tree reference.
Source§

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>

Get the last revision ID.
Source§

fn lock_tree_write(&self) -> Result<Lock, Error>

Lock the tree for write operations.
Source§

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>

Set the parent trees for this tree.
Source§

fn apply_inventory_delta(&self, delta: Vec<InventoryDelta>) -> Result<(), Error>

Apply a delta to the tree.
Source§

fn commit( &self, message: &str, committer: Option<&str>, timestamp: Option<f64>, allow_pointless: Option<bool>, specific_files: Option<&[&Path]>, ) -> Result<RevisionId, Error>

Commit changes in the tree.
Source§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> Tree for T
where T: PyTree + ?Sized,

Source§

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>

Get a file from the tree as a readable stream.
Source§

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>

Get the contents of a file as a vector of lines (byte vectors).
Source§

fn lock_read(&self) -> Result<Lock, Error>

Lock the tree for read operations.
Source§

fn has_filename(&self, path: &Path) -> bool

Check if a file exists in the tree at the specified path.
Get the target of a symbolic link.
Source§

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>

Check if a path is ignored by version control.
Source§

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

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>

Iterate through the changes between this tree and another tree. Read more
Source§

fn has_versioned_directories(&self) -> bool

Check if this tree supports versioned directories.
Source§

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>

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>

Iterate through entries in a directory. Read more
Source§

fn get_file_size(&self, path: &Path) -> Result<u64, Error>

Get the size of a file in bytes.
Source§

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>

Get the modification time of a file.
Source§

fn is_executable(&self, path: &Path) -> Result<bool, Error>

Check if a file is executable.
Source§

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

Check if the tree supports content filtering.
Source§

fn supports_file_ids(&self) -> bool

Check if the tree supports file IDs.
Source§

fn supports_rename_tracking(&self) -> bool

Check if the tree supports rename tracking.
Check if the tree supports symbolic links.
Source§

fn supports_tree_reference(&self) -> bool

Check if the tree supports tree references.
Source§

fn unknowns(&self) -> Result<Vec<PathBuf>, Error>

Get unversioned files in the tree.
Source§

fn all_versioned_paths( &self, ) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>

Get all versioned paths in the tree.
Source§

fn conflicts(&self) -> Result<Vec<Conflict>, Error>

Get conflicts in the tree.
Source§

fn extras(&self) -> Result<Vec<PathBuf>, Error>

Get extra (unversioned) files in the tree.
Source§

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>

Walk directories in the tree.
Source§

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>

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>

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>

Iterate through entries by directory.
Source§

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>

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>

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>

Annotate a file with revision information.
Source§

fn is_special_path(&self, path: &Path) -> bool

Check if a path is a special path (e.g., control directory).
Source§

fn iter_search_rules( &self, paths: &[&Path], ) -> Result<Box<dyn Iterator<Item = Result<SearchRule, Error>>>, Error>

Iterate through search rules.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Ungil for T
where T: Send,