pub trait CompilerVersionManager: Debug + Send + Sync {
    type Compiler: Compiler;

    // Required methods
    fn all_versions(&self) -> Vec<CompilerVersion>;
    fn installed_versions(&self) -> Vec<CompilerVersion>;
    fn install(
        &self,
        version: &Version
    ) -> Result<Self::Compiler, VersionManagerError>;
    fn get_installed(
        &self,
        version: &Version
    ) -> Result<Self::Compiler, VersionManagerError>;

    // Provided method
    fn get_or_install(
        &self,
        version: &Version
    ) -> Result<Self::Compiler, VersionManagerError> { ... }
}
Expand description

Abstraction over a compiler version manager. Currently main implementation is SolcVersionManager. Acts as a factory of Compilers.

Required Associated Types§

Required Methods§

source

fn all_versions(&self) -> Vec<CompilerVersion>

Returns all versions available locally and remotely.

source

fn installed_versions(&self) -> Vec<CompilerVersion>

Returns all versions available locally.

source

fn install( &self, version: &Version ) -> Result<Self::Compiler, VersionManagerError>

Installs a compiler version and returns the compiler instance.

source

fn get_installed( &self, version: &Version ) -> Result<Self::Compiler, VersionManagerError>

Returns the compiler instance for the given version if it is installed. If not, returns an error.

Provided Methods§

source

fn get_or_install( &self, version: &Version ) -> Result<Self::Compiler, VersionManagerError>

Returns the compiler instance for the given version if it is installed. If not, installs it.

Implementations on Foreign Types§

source§

impl<'a, T: 'a + CompilerVersionManager + ?Sized> CompilerVersionManager for &'a T
where &'a T: Debug + Send + Sync,

source§

impl<T: CompilerVersionManager + ?Sized> CompilerVersionManager for Box<T>
where Box<T>: Debug + Send + Sync,

source§

impl<T: CompilerVersionManager + ?Sized> CompilerVersionManager for Arc<T>
where Arc<T>: Debug + Send + Sync,

Implementors§

source§

impl CompilerVersionManager for SolcVersionManager

Available on crate feature svm-solc only.