pub struct PatchManager { /* private fields */ }Expand description
Manages patched dependencies.
Patches are stored as .patch files in a patches/ directory and applied during install.
Implementations§
Source§impl PatchManager
impl PatchManager
pub fn new(project_root: PathBuf, patches: HashMap<String, String>) -> Self
Sourcepub fn prepare_patch(
&self,
package_name: &str,
version: &str,
) -> Result<PathBuf>
pub fn prepare_patch( &self, package_name: &str, version: &str, ) -> Result<PathBuf>
Prepare a package for patching by extracting it to a temp directory. Returns the path to the temp directory where the user can make changes.
Sourcepub fn commit_patch(&self, patch_dir: &Path) -> Result<PathBuf>
pub fn commit_patch(&self, patch_dir: &Path) -> Result<PathBuf>
Commit a patch by generating a diff between the original installed package
and the modified version in the patch directory.
Writes the patch file to patches/<pkg>@<version>.patch.
Sourcepub fn apply_patches(&self) -> Result<PatchStats>
pub fn apply_patches(&self) -> Result<PatchStats>
Apply all configured patches to installed packages. Called after linking during install.
Auto Trait Implementations§
impl Freeze for PatchManager
impl RefUnwindSafe for PatchManager
impl Send for PatchManager
impl Sync for PatchManager
impl Unpin for PatchManager
impl UnsafeUnpin for PatchManager
impl UnwindSafe for PatchManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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