-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API changes for v3 #21
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
trans prepare (and commit) currently look like this: pub fn trans_prepare(&mut self) -> Result<(), (PrepareResult<'_>, Error)> With PrepareResult being: pub enum PrepareResult<'a> {
PkgInvalidArch(AlpmListMut<'a, Package<'a>>),
UnsatisfiedDeps(AlpmListMut<'a, DependMissing>),
ConflictingDeps(AlpmListMut<'a, OwnedConflict>),
Ok,
} This can be a bit awkward as you can't just Also It should probably be more like |
I'm considering inverting how the structs work for v3. instead of a Pkg struct that contains a pointer it will be &Pkg that contains an alpm_pkg_t. Then like &str, &Pkg will only be holdable by reference. I think that may work better for some ergonomics. |
Unions can be done in a way that doesn't require us to match on them: https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md |
I got around to implementing all of this in https://github.com/archlinux/alpm.rs/tree/v3. Only think not done is transmuting the unions to enums directly. As due to padding that would require putting all the fields in the enum variant directly and not a struct. Which then causes issues as I wish to keep them private. Don't expect this any time soon as I don't see a new pacman any time soon and it also depend on an un merged patch. |
No it's fine as is.Actually noThe text was updated successfully, but these errors were encountered: