aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/operation/operation_interface.rs
blob: f90649d354b6cff7c4a2cc86f8e63b4ee6acc168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! ref: composer/src/Composer/DependencyResolver/Operation/OperationInterface.php

use crate::dependency_resolver::operation::install_operation::InstallOperation;
use crate::dependency_resolver::operation::uninstall_operation::UninstallOperation;
use crate::dependency_resolver::operation::update_operation::UpdateOperation;

pub trait OperationInterface: std::fmt::Debug {
    fn as_any(&self) -> &dyn std::any::Any;

    fn get_operation_type(&self) -> String;

    fn show(&self, lock: bool) -> String;

    fn to_string(&self) -> String;

    fn clone_box(&self) -> Box<dyn OperationInterface> {
        todo!()
    }

    fn as_install_operation(&self) -> Option<&InstallOperation> {
        None
    }

    fn as_update_operation(&self) -> Option<&UpdateOperation> {
        None
    }

    fn as_uninstall_operation(&self) -> Option<&UninstallOperation> {
        None
    }
}