aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/plugin/capability/capability.rs
blob: aa70ffa0b854377490adbc77d0185c70b6816900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! ref: composer/src/Composer/Plugin/Capability/Capability.php

use crate::plugin::capability::CommandProvider;

/// Marker interface for Plugin capabilities. Every new Capability which is added to the
/// Plugin API must implement this interface.
///
/// The accessor replaces PHP's `instanceof` downcast on a capability instance of unknown
/// concrete type (the way `PluginInterface::as_capable` does for plugins).
pub trait Capability {
    fn as_command_provider(&self) -> Option<&dyn CommandProvider> {
        None
    }
}