Skip to main content

Assets

Struct Assets 

Source
#[non_exhaustive]
pub struct Assets { pub bin: Option<String>, pub prepare: Option<Vec<String>>, pub build: Option<Vec<String>>, pub binary: Option<String>, pub dir: Option<PathBuf>, pub files: Vec<PathBuf>, pub generated: Vec<Generated>, pub targets: BTreeMap<String, AssetTarget>, }
Expand description

Native GitHub Release tarballs, plus the recipe every target shares. Omit for libraries. Each named sub-mapping is one target.

A tarball contains the one binary, or the files packed from dir. Use files when a release needs more than its binary, such as a second executable, a service unit, or a licence. A target that ships other files lists its own files, which replace the shared list for that target.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§bin: Option<String>

The binary name. Defaults to the first package’s name.

§prepare: Option<Vec<String>>

Ran once per target before build. Stock rust recipe uses rustup.

§build: Option<Vec<String>>

How to produce the binary. Stock rust recipe is cargo build --release.

§binary: Option<String>

Path to the built binary, with {bin}, {triple}, {os}, and {arch}. Omit for target/{triple}/release/{bin}. Unused when dir and files specify what to pack, so it may not be set beside them.

§dir: Option<PathBuf>

The directory files are packed from, relative to the directory containing .ctl/, with the same placeholders as binary. Omit, with files, to pack the one binary.

§files: Vec<PathBuf>

Paths under dir packed into the tarball of every target that lists none of its own, with the same placeholders. Each keeps its place under dir. A directory is packed whole. Omit, with dir, to pack the one binary, or when every target lists its own.

§generated: Vec<Generated>

Files written from a command’s output and packed into the tarball of every target beside the binary, such as a usage spec or a man page the built binary prints. Omit when the tarball contains nothing generated.

§targets: BTreeMap<String, AssetTarget>

Every remaining sub-mapping: assets.linux-x64 and friends. A typo’d recipe key lands here and fails as an unknown target, loudly. Config::load declares this field to ctl-core as flattened, so a problem names assets.<id> and lands on that key’s line.

Implementations§

Source§

impl Assets

Source

pub const SETTINGS: [&'static str; 7]

The keys under assets that are settings, every other key being a target id. A reader that takes only the target ids of an old config leaves these out.

Trait Implementations§

Source§

impl Clone for Assets

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 Assets

Source§

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

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

impl Default for Assets

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Assets

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 Validate for Assets

Source§

type Context = Config

A user-provided context. Read more
Source§

fn validate_into( &self, __garde_user_ctx: &Self::Context, __garde_path: &mut dyn FnMut() -> Path, __garde_report: &mut Report, )

Validates Self, aggregating all validation errors into Report.
Source§

fn validate(&self) -> Result<(), Report>
where Self::Context: Default,

Validates Self, returning an Err with an aggregate of all errors if the validation failed. Read more
Source§

fn validate_with(&self, ctx: &Self::Context) -> Result<(), Report>

Validates Self, returning an Err with an aggregate of all errors if the validation failed. Read more

Auto Trait Implementations§

§

impl Forget for Assets

§

impl Freeze for Assets

§

impl Move for Assets

§

impl RefUnwindSafe for Assets

§

impl Send for Assets
where RawVecInner: Send, NodeRef<Owned, String, AssetTarget, LeafOrInternal>: Send, BoxRaw<(String, AssetTarget)>: Send,

§

impl Sync for Assets
where RawVecInner: Sync, NodeRef<Owned, String, AssetTarget, LeafOrInternal>: Sync, BoxRaw<(String, AssetTarget)>: Sync,

§

impl Unpin for Assets
where *const u8 is !null: Unpin, *const LeafNode<String, AssetTarget> is !null: Unpin, Box<(String, AssetTarget)>: Unpin,

§

impl UnsafeUnpin for Assets

§

impl UnwindSafe for Assets

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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,

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.