Skip to main content

Manifest

Struct Manifest 

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

The record of one produced sysroot.

Implementations§

Source§

impl Manifest

Source

pub const fn new(target: TargetTuple) -> Self

An empty manifest for this target.

Source

pub const fn target(&self) -> TargetTuple

The target this sysroot is for.

Source

pub const fn kernel(&self) -> Option<Version>

The Linux release the kernel headers in this sysroot came out of, when one was recorded.

Absent has one meaning and it is not “nobody knows”: it is that this sysroot has no kernel headers in it. Every target that is not Linux is in that case, and so is a Linux sysroot produced before a kernel tree was installed beside it, which is a state the producer allows because the two trees are two commands. That is the one thing an optional line can mean here and it is why this one is optional where the provenance field is not: a file with no kernel headers in it has no kernel version, and an input always came from somewhere.

What it is for is the question somebody asks after a cross build read a header nobody expected. -print-sysroot answers where and the manifest answers what, and a sysroot whose record names the release its linux/ headers came out of makes a stale pairing visible instead of leaving it to be guessed at. Nothing here checks the version against the headers themselves, which is tamnd/rucc#925’s argument applied to the kernel tree rather than to glibc.

Source

pub const fn set_kernel(&mut self, version: Version)

Record which Linux release the kernel headers came out of.

Infallible, and in particular it does not refuse a target that has no kernel headers. The property this type owes its callers is that Manifest::parse reads back what Manifest::render wrote, so the reader accepts every manifest a producer can build and a kernel line on a Windows sysroot is a bug in the producer rather than a corrupt file.

Source

pub fn inputs(&self) -> &[Input]

Every input, in the order they were added.

Source

pub fn push(&mut self, input: Input)

Record one input.

Source

pub fn redistributable(&self) -> bool

Whether an artifact containing this whole sysroot can be published.

One input under a licence that says no makes the answer no, which is the only reading of a licence wall that is worth anything.

Source

pub fn sources(&self) -> Vec<&str>

Every distinct source in the manifest, sorted.

What a person asks first when two manifests differ, and what a licence notice is generated from.

Source

pub fn render(&self) -> String

The manifest as text, sorted by path.

The sort is what makes two runs comparable. A directory walk returns files in whatever order the filesystem keeps them, which differs between ext4 and APFS and sometimes between two runs on one of them, and a manifest that carried that order would report a difference between two identical sysroots.

Source

pub fn parse(text: &str) -> Result<Self, ManifestError>

Read a manifest back.

§Errors

Returns which line was wrong and what was wrong with it. A manifest that fails to parse is a cache entry somebody has to decide about, and “invalid manifest” is not enough to decide with.

Trait Implementations§

Source§

impl Clone for Manifest

Source§

fn clone(&self) -> Manifest

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 Manifest

Source§

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

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

impl Eq for Manifest

Source§

impl PartialEq for Manifest

Source§

fn eq(&self, other: &Manifest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Manifest

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