pub struct Transaction<Old, New> {
pub operations: Vec<TransactionOperation<Old, New>>,
pub python_info: Option<PythonInfo>,
pub current_python_info: Option<PythonInfo>,
pub platform: Platform,
pub unchanged: Vec<Old>,
}Expand description
Describes the operations to perform to bring an environment from one state into another.
Fields§
§operations: Vec<TransactionOperation<Old, New>>A list of operations to update an environment
python_info: Option<PythonInfo>The python version of the target state, or None if python doesnt exist in the environment.
current_python_info: Option<PythonInfo>The python version of the current state, or None if python didnt exist in the previous environment.
platform: PlatformThe target platform of the transaction
unchanged: Vec<Old>The records that are not touched by the transaction.
Implementations§
Source§impl<Old: Clone, New: Clone> Transaction<&Old, &New>
impl<Old: Clone, New: Clone> Transaction<&Old, &New>
Sourcepub fn to_owned(self) -> Transaction<Old, New>
pub fn to_owned(self) -> Transaction<Old, New>
Own records.
Source§impl<Old, New> Transaction<Old, New>
impl<Old, New> Transaction<Old, New>
Sourcepub fn removed_packages(&self) -> impl Iterator<Item = &Old> + '_
pub fn removed_packages(&self) -> impl Iterator<Item = &Old> + '_
Return an iterator over the prefix records of all packages that are going to be removed.
Sourcepub fn unchanged_packages(&self) -> &[Old]
pub fn unchanged_packages(&self) -> &[Old]
Return an iterator over the records that are not touched by the transaction
Sourcepub fn packages_to_uninstall(&self) -> usize
pub fn packages_to_uninstall(&self) -> usize
Returns the number of records to install.
Source§impl<Old, New> Transaction<Old, New>
impl<Old, New> Transaction<Old, New>
Sourcepub fn installed_packages(&self) -> impl Iterator<Item = &New> + '_
pub fn installed_packages(&self) -> impl Iterator<Item = &New> + '_
Return an iterator over the prefix records of all packages that are going to be installed.
Sourcepub fn packages_to_install(&self) -> usize
pub fn packages_to_install(&self) -> usize
Returns the number of records to install.
Source§impl<Old, New> Transaction<Old, New>where
Old: ContentComparable,
New: ContentComparable,
impl<Old, New> Transaction<Old, New>where
Old: ContentComparable,
New: ContentComparable,
Sourcepub fn from_current_and_desired<CurIter: IntoIterator<Item = Old>, NewIter: IntoIterator<Item = New>>(
current: CurIter,
desired: NewIter,
reinstall: Option<&HashSet<PackageName>>,
ignored: Option<&HashSet<PackageName>>,
platform: Platform,
) -> Result<Self, TransactionError>
pub fn from_current_and_desired<CurIter: IntoIterator<Item = Old>, NewIter: IntoIterator<Item = New>>( current: CurIter, desired: NewIter, reinstall: Option<&HashSet<PackageName>>, ignored: Option<&HashSet<PackageName>>, platform: Platform, ) -> Result<Self, TransactionError>
Constructs a Transaction by taking the current situation and diffing
that against the desired situation. You can specify a set of package
names that should be reinstalled even if their content has not
changed. You can also specify a set of package names that should be
ignored (left untouched).
Source§impl<New> Transaction<InstallationResultRecord, New>
impl<New> Transaction<InstallationResultRecord, New>
Sourcepub fn into_prefix_record(
self,
prefix: impl AsRef<Path>,
) -> Result<Transaction<PrefixRecord, New>, Error>
pub fn into_prefix_record( self, prefix: impl AsRef<Path>, ) -> Result<Transaction<PrefixRecord, New>, Error>
Convert transaction to contain PrefixRecord instead of InstallationResultRecord.
Source§impl<New> Transaction<PrefixRecord, New>
impl<New> Transaction<PrefixRecord, New>
Sourcepub fn into_installation_result_record(
self,
) -> Transaction<InstallationResultRecord, New>
pub fn into_installation_result_record( self, ) -> Transaction<InstallationResultRecord, New>
Convert transaction to contain InstallationResultRecord instead of PrefixRecord.
Trait Implementations§
Auto Trait Implementations§
impl<Old, New> Freeze for Transaction<Old, New>
impl<Old, New> RefUnwindSafe for Transaction<Old, New>where
Old: RefUnwindSafe,
New: RefUnwindSafe,
impl<Old, New> Send for Transaction<Old, New>
impl<Old, New> Sync for Transaction<Old, New>
impl<Old, New> Unpin for Transaction<Old, New>
impl<Old, New> UnwindSafe for Transaction<Old, New>where
Old: UnwindSafe,
New: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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