aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/archiver/archiver_interface.rs
blob: 54121b59456e15364e2539ece13a9f4f4e541223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! ref: composer/src/Composer/Package/Archiver/ArchiverInterface.php

use std::any::Any;

pub trait ArchiverInterface {
    fn archive(
        &self,
        sources: String,
        target: String,
        format: String,
        excludes: Vec<String>,
        ignore_filters: bool,
    ) -> anyhow::Result<String>;

    fn supports(&self, format: String, source_type: Option<String>) -> bool;

    /// PHP `$archiver instanceof X` checks; allow downcasting from `dyn ArchiverInterface`.
    fn as_any(&self) -> &dyn Any;
}