pub struct Package(/* private fields */);Expand description
One loaded package: its dotted name (e.g. veh.common), its files, where
it came from, its own manifest’s [imports] map, and its interface lock.
imports is ADR-0002 §5 step 2: the [imports] of the manifest governing
this package’s directory tree. It shadows the workspace [imports] for
this package only — a member’s pin is never visible to a sibling member.
Every package loaded from one manifest’s tree (the root and its
subdirectory packages) carries that manifest’s map; a single-file package
and ridl.std carry an empty map.
Implementations§
Source§impl Package
impl Package
pub fn ingredient(db: &dyn Database) -> &IngredientImpl<Self>
pub fn ingredient_mut( zalsa_mut: &mut Zalsa, ) -> (&mut IngredientImpl<Self>, &mut Runtime)
Source§impl Package
impl Package
pub fn new<Db_>( db: &Db_, name: String, files: Vec<InputFile>, origin: PackageOrigin, imports: BTreeMap<String, String>, default_timing: Option<String>, lock: Option<PackageLock>, ) -> Self
pub fn builder( name: String, files: Vec<InputFile>, origin: PackageOrigin, imports: BTreeMap<String, String>, default_timing: Option<String>, lock: Option<PackageLock>, ) -> <Self as HasBuilder>::Builder
pub fn name<'db, Db_>(self, db: &'db Db_) -> &'db String
pub fn files<'db, Db_>(self, db: &'db Db_) -> &'db Vec<InputFile>
pub fn origin<'db, Db_>(self, db: &'db Db_) -> &'db PackageOrigin
pub fn imports<'db, Db_>(self, db: &'db Db_) -> &'db BTreeMap<String, String>
Sourcepub fn default_timing<'db, Db_>(self, db: &'db Db_) -> &'db Option<String>
pub fn default_timing<'db, Db_>(self, db: &'db Db_) -> &'db Option<String>
The raw [defaults].timing string that governs this package (ADR-0002
§5 precedence: package [defaults] shadows workspace [defaults],
merged at load), or None when no manifest configures one — the
checker then applies the built-in [100ms..1000ms] (ridl §9.1). Stored
unparsed: ridl-core cannot depend on ridl-sem (E2 task 9).
Sourcepub fn lock<'db, Db_>(self, db: &'db Db_) -> &'db Option<PackageLock>
pub fn lock<'db, Db_>(self, db: &'db Db_) -> &'db Option<PackageLock>
The package’s interfaces.lock, read by the loader from the package
directory (lock design §2), or None when the directory has no such
file, when the file is malformed (the loader reports RIDL-410 and
drops it), or when the package was not loaded from a directory (a
source string, ridl.std). The checker reads it to give every
interface its number; without it every number is provisional.
pub fn set_name<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = String>
pub fn set_files<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Vec<InputFile>>
pub fn set_origin<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = PackageOrigin>
pub fn set_imports<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = BTreeMap<String, String>>
pub fn set_default_timing<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<String>>
pub fn set_lock<'db, Db_>( self, db: &'db mut Db_, ) -> impl Setter<FieldTy = Option<PackageLock>>
Sourcepub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Result
pub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Result
Default debug formatting for this struct (may be useful if you define your own Debug impl)
Trait Implementations§
Source§impl Configuration for Package
impl Configuration for Package
const LOCATION: Location
const DEBUG_NAME: &'static str = "Package"
const FIELD_DEBUG_NAMES: &'static [&'static str]
Source§type Fields = (String, Vec<InputFile>, PackageOrigin, BTreeMap<String, String>, Option<String>, Option<PackageLock>)
type Fields = (String, Vec<InputFile>, PackageOrigin, BTreeMap<String, String>, Option<String>, Option<PackageLock>)
type Revisions = [Revision; 6]
type Durabilities = [Durability; 6]
Source§fn serialize<S: Serializer>(
fields: &Self::Fields,
serializer: S,
) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>( fields: &Self::Fields, serializer: S, ) -> Result<S::Ok, S::Error>
serde. Read moreSource§fn deserialize<'de, D: Deserializer<'de>>(
deserializer: D,
) -> Result<Self::Fields, D::Error>
fn deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self::Fields, D::Error>
serde. Read moreimpl Copy for Package
impl Eq for Package
Source§impl SalsaStructInDb for Package
impl SalsaStructInDb for Package
Source§const LEAF_TYPE_IDS: &'static [ConstTypeId]
const LEAF_TYPE_IDS: &'static [ConstTypeId]
type MemoIngredientMap = MemoIngredientSingletonIndex
Source§fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices
Source§fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
impl SalsaValue for Package
impl StructuralPartialEq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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