struct TransactionPlan {
uuid: Uuid,
actions: Vec<ActionItem>,
data_dir: PathBuf,
}Expand description
The plan of a transaction in an alpm-db.
A transaction plan consists of one or more action items and serves as a persisted plan of “what is done in a transaction”.
Fields§
§uuid: Uuid§actions: Vec<ActionItem>§data_dir: PathBufImplementations§
Source§impl TransactionPlan
impl TransactionPlan
Sourcepub fn write_to_current_dir(&self) -> Result<(), Error>
pub fn write_to_current_dir(&self) -> Result<(), Error>
Writes Self as JSON encoded file in the “current” location of the data dir.
§Errors
Returns an error, if
- the transaction plan cannot be turned into a JSON string
- the output file cannot be opened for writing
- the transaction plan cannot be written to the output file
Sourcepub fn move_to_past_transaction_dir(&self) -> Result<(), Error>
pub fn move_to_past_transaction_dir(&self) -> Result<(), Error>
Moves the “current” transaction plan to the “past” location of the data dir.
§Errors
Returns an error, if the current transaction plan cannot be moved (e.g. because it has not
yet been persisted - see Self::write_to_current_dir).
Trait Implementations§
Source§impl Clone for TransactionPlan
impl Clone for TransactionPlan
Source§impl Debug for TransactionPlan
impl Debug for TransactionPlan
Source§impl<'de> Deserialize<'de> for TransactionPlan
impl<'de> Deserialize<'de> for TransactionPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TransactionPlan
Source§impl From<&Transaction> for TransactionPlan
impl From<&Transaction> for TransactionPlan
Source§fn from(value: &Transaction) -> Self
fn from(value: &Transaction) -> Self
Converts to this type from the input type.
Source§impl Ord for TransactionPlan
impl Ord for TransactionPlan
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for TransactionPlan
impl PartialEq for TransactionPlan
Source§impl PartialOrd for TransactionPlan
impl PartialOrd for TransactionPlan
Source§impl Serialize for TransactionPlan
impl Serialize for TransactionPlan
impl StructuralPartialEq for TransactionPlan
Auto Trait Implementations§
impl Freeze for TransactionPlan
impl RefUnwindSafe for TransactionPlan
impl Send for TransactionPlan
impl Sync for TransactionPlan
impl Unpin for TransactionPlan
impl UnsafeUnpin for TransactionPlan
impl UnwindSafe for TransactionPlan
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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