Skip to main content

ExternalPackages

Struct ExternalPackages 

Source
pub struct ExternalPackages { /* private fields */ }
Expand description

Packages to reference rather than generate, keyed by package id or package name.

The name form is the one to prefer: a package id is the hash of one build, so pinning by id stops matching the moment the dependency is rebuilt, while the name survives a version bump — which is the whole point of addressing packages by name under Smart Contract Upgrade.

Implementations§

Source§

impl ExternalPackages

Source

pub fn new() -> Self

An empty map — everything in the DAR is generated.

Source

pub fn with(self, key: impl Into<String>, crate_name: impl Into<String>) -> Self

Reference the package identified by key (its name, or its id hash) at the crate crate_name, instead of generating it.

Source

pub fn with_prefixed( self, prefix: impl Into<String>, crate_name: impl Into<String>, ) -> Self

Reference every package whose name is prefix, or begins with prefix-, at crate_name.

For a family that arrives as many packages — the standard library is some thirty, and which of them a DAR carries depends on what its Daml source touched. An exact list is right for one DAR and wrong for the next; the family is what is meant.

Source

pub fn crate_names(&self) -> Vec<String>

The crate names named here, sorted — what a generated manifest must depend on.

Trait Implementations§

Source§

impl Clone for ExternalPackages

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ExternalPackages

Source§

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

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

impl Default for ExternalPackages

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.