Skip to main content

PortableView

Struct PortableView 

Source
pub struct PortableView {
    pub id: String,
    pub name: String,
    pub scope: PortableScope,
    pub resolution: String,
    pub plan: Table,
    pub normalized_plan: Option<Table>,
    pub extensions: Table,
    pub diagnostics: Vec<PortableDiagnostic>,
    pub extra: Table,
}
Expand description

One saved view in the portable form (data-model §1).

plan is the [plan] table as written, so a consumer can rebuild the stored definition byte for byte; normalized_plan is the same plan after ViewPlan::from_toml/ViewPlan::to_toml, which is the one normalized plan every surface consumes (C-007) and is None exactly when this build cannot interpret the stored plan — in which case the refusal’s diagnostics are carried in diagnostics and the plan table is still retained.

Fields§

§id: String

The stable identity. Immutable across rename; never reused.

§name: String

The display label. Mutable — it is not the identity.

§scope: PortableScope

The explicit scope metadata.

§resolution: String

The scope’s derived resolution (resolved, missing, conflict).

§plan: Table

The persisted [plan] table, verbatim.

§normalized_plan: Option<Table>

The normalized plan, when this build can interpret it.

§extensions: Table

Record-level fields this build does not interpret, preserved verbatim.

§diagnostics: Vec<PortableDiagnostic>

Unknown-metadata, scope, namespace, and executable-content diagnostics.

§extra: Table

View keys a newer portable format adds, preserved verbatim.

Implementations§

Source§

impl PortableView

Source

pub fn from_saved<P: ProjectDirectory + ?Sized>( view: &SavedView, projects: &P, registry_diagnostics: &[ViewDiagnostic], ) -> Self

Project one stored view, given the registry-level diagnostics the caller’s registry pass produced for it.

The registry’s own diagnostics are reused rather than recomputed, so the scope/unknown-field vocabulary has exactly one author; the keys this module classifies (a remote target name, an executable name) replace the generic “unknown field” notice for the same field instead of duplicating it.

Source

pub fn id(&self) -> &str

The stable identity.

Source

pub fn normalized_plan(&self) -> Option<&Table>

The normalized plan, when this build can interpret it.

Source

pub fn diagnostics(&self) -> &[PortableDiagnostic]

Every diagnostic about this view.

Trait Implementations§

Source§

impl Clone for PortableView

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 PortableView

Source§

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

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

impl<'de> Deserialize<'de> for PortableView

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 PartialEq for PortableView

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for PortableView

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
Source§

impl StructuralPartialEq for PortableView

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