Package

Struct Package 

Source
pub struct Package {
Show 36 fields pub name: String, pub version: Option<Version>, pub description: Option<String>, pub authors: Vec<String>, pub requires: Vec<String>, pub build_requires: Vec<String>, pub private_build_requires: Vec<String>, pub variants: Vec<Vec<String>>, pub tools: Vec<String>, pub commands: Option<String>, pub build_command: Option<String>, pub build_system: Option<String>, pub pre_commands: Option<String>, pub post_commands: Option<String>, pub pre_test_commands: Option<String>, pub pre_build_commands: Option<String>, pub tests: HashMap<String, String>, pub requires_rez_version: Option<String>, pub uuid: Option<String>, pub config: HashMap<String, String>, pub help: Option<String>, pub relocatable: Option<bool>, pub cachable: Option<bool>, pub timestamp: Option<i64>, pub revision: Option<String>, pub changelog: Option<String>, pub release_message: Option<String>, pub previous_version: Option<Version>, pub previous_revision: Option<String>, pub vcs: Option<String>, pub format_version: Option<i32>, pub base: Option<String>, pub has_plugins: Option<bool>, pub plugin_for: Vec<String>, pub hashed_variants: Option<bool>, pub preprocess: Option<String>,
}
Expand description

High-performance package representation compatible with rez

Fields§

§name: String

Package name (non-Python version)

§version: Option<Version>

Package version (non-Python version)

§description: Option<String>

Package description (non-Python version)

§authors: Vec<String>

Package authors (non-Python version)

§requires: Vec<String>

Package requirements

§build_requires: Vec<String>

Build requirements

§private_build_requires: Vec<String>

Private build requirements

§variants: Vec<Vec<String>>

Package variants

§tools: Vec<String>

Package tools

§commands: Option<String>

Package commands

§build_command: Option<String>

Build command for custom builds

§build_system: Option<String>

Build system type

§pre_commands: Option<String>

Pre commands (executed before main commands)

§post_commands: Option<String>

Post commands (executed after main commands)

§pre_test_commands: Option<String>

Pre test commands (executed before tests)

§pre_build_commands: Option<String>

Pre build commands (executed before build)

§tests: HashMap<String, String>

Package tests

§requires_rez_version: Option<String>

Required rez version

§uuid: Option<String>

Package UUID (non-Python version)

§config: HashMap<String, String>

Package config (non-Python version)

§help: Option<String>

Package help

§relocatable: Option<bool>

Package relocatable flag

§cachable: Option<bool>

Package cachable flag

§timestamp: Option<i64>

Package timestamp

§revision: Option<String>

Package revision

§changelog: Option<String>

Package changelog

§release_message: Option<String>

Package release message

§previous_version: Option<Version>

Previous version

§previous_revision: Option<String>

Previous revision

§vcs: Option<String>

VCS type

§format_version: Option<i32>

Package format version

§base: Option<String>

Package base

§has_plugins: Option<bool>

Package has plugins

§plugin_for: Vec<String>

Plugin for packages

§hashed_variants: Option<bool>

Package hashed variants

§preprocess: Option<String>

Package preprocess function

Implementations§

Source§

impl Package

Source

pub fn new(name: String) -> Self

Source

pub fn qualified_name(&self) -> String

Get the qualified name of the package (name-version)

Source

pub fn as_exact_requirement(&self) -> String

Get the package as an exact requirement string

Source

pub fn is_package(&self) -> bool

Check if this is a package (always true for Package)

Source

pub fn is_variant(&self) -> bool

Check if this is a variant (always false for Package)

Source

pub fn num_variants(&self) -> usize

Get the number of variants

Source

pub fn set_version(&mut self, version: Version)

Set the package version

Source

pub fn set_description(&mut self, description: String)

Set the package description

Source

pub fn add_author(&mut self, author: String)

Add an author

Source

pub fn add_requirement(&mut self, requirement: String)

Add a requirement

Source

pub fn add_build_requirement(&mut self, requirement: String)

Add a build requirement

Source

pub fn add_private_build_requirement(&mut self, requirement: String)

Add a private build requirement

Source

pub fn add_variant(&mut self, variant: Vec<String>)

Add a variant

Source

pub fn add_tool(&mut self, tool: String)

Add a tool

Source

pub fn set_commands(&mut self, commands: String)

Set commands

Source

pub fn validate(&self) -> Result<(), RezCoreError>

Validate the package definition

Trait Implementations§

Source§

impl Clone for Package

Source§

fn clone(&self) -> Self

Returns a duplicate 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 Package

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Package

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Package

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

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

Source§

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>,

Source§

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>,

Source§

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, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,