Skip to content

feat(mount): add PartialEq#912

Open
amab8901 wants to merge 1 commit intotestcontainers:mainfrom
amab8901:aa/mount_partialeq
Open

feat(mount): add PartialEq#912
amab8901 wants to merge 1 commit intotestcontainers:mainfrom
amab8901:aa/mount_partialeq

Conversation

@amab8901
Copy link
Contributor

@amab8901 amab8901 commented Jan 19, 2026

fixes #911

@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for testcontainers-rust ready!

Name Link
🔨 Latest commit d3d7d13
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-rust/deploys/696e2c2cb3d8ef000826900e
😎 Deploy Preview https://deploy-preview-912--testcontainers-rust.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

/// Represents a filesystem mount.
/// For more information see [Docker Storage](https://docs.docker.com/storage/) documentation.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
Copy link
Contributor

@DDtKey DDtKey Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might not work as expected because equality here isn’t just about comparing all fields. For instance, if access, permissions or tmpfs size are different but point to the same target path, should it be considered equal or not? It depends on the use case - but in most of cases you most likely only interested in unique mount per target or (source, target)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the way I implemented it now works for my use case (I'm using a fork of testconainers as a dependency to my project until this PR is merged).

If someone has a use case where they only care about some fields but not others, then a method can be added for those cases, like Mount::eq_target_path(other: Mount)

@DDtKey DDtKey changed the title fix(mount): add PartialEq feat(mount): add PartialEq Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compare mounts

2 participants