Struct sccmod::module::Module

source ·
pub struct Module {
    pub name: String,
    pub version: String,
    pub class: String,
    pub dependencies: Vec<Dependency>,
    pub metadata: HashMap<String, String>,
    pub environment: Vec<(String, Environment)>,
    pub pre_build: Option<Vec<String>>,
    pub downloader: Option<Downloader>,
    pub builder: Option<Builder>,
    pub source_path: String,
    pub build_path: String,
    pub install_path: String,
}

Fields§

§name: String

Name of the module

§version: String

Module version

§class: String

Module class (flavours)

§dependencies: Vec<Dependency>

Module dependencies

§metadata: HashMap<String, String>

Module metadata

§environment: Vec<(String, Environment)>

Environment variables to set/change

§pre_build: Option<Vec<String>>

A list of commands to run before building

§downloader: Option<Downloader>

Downloader to download the source code

§builder: Option<Builder>

Builder to build and install the source code

§source_path: String§build_path: String§install_path: String

Implementations§

source§

impl Module

source

pub fn parse( &self, flavour: &(&[Module], usize) ) -> (String, String, String, Vec<String>)

Parse a flavour into:

  • flavour_str: a postfix to a path pointing to a flavour directory
  • build_path: updated build path
  • install_path: updated install path
  • modules: module names necessary for installation
source

pub fn identifier(&self) -> String

source

pub fn mod_name(&self) -> String

source

pub fn download(&self) -> Result<(), String>

Download the source code for the module, based on its Downloader.

§Errors

This will error if the download fails, with an error String containing either an error message or the output of the errored command.

source

pub fn build(&self, flavour: (&[Module], usize)) -> Result<(), String>

Build the source code for this module, based on its Builder.

§Errors

This will error if the build fails, with an error String containing either an error message or the output of the errored command.

source

pub fn install(&self, flavour: (&[Module], usize)) -> Result<(), String>

Install the source code for this module based on its Builder.

§Errors

Errors if the installation fails. The Result output contains a String with either an error message or the output of the errored program.

source

pub fn from_object( object: &Bound<'_, PyAny>, config: &Config ) -> Result<Self, String>

Extract a Module object from a python object.

§Errors

This method will return [Err(msg)] if the object cannot be parsed successfully. msg is a string and contains the error message.

source

pub fn modulefile(&self) -> Result<(), String>

Trait Implementations§

source§

impl Clone for Module

source§

fn clone(&self) -> Module

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Module

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl Send for Module

§

impl Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Ungil for T
where T: Send,