Skip to main content

ManifestRepository

Struct ManifestRepository 

Source
pub struct ManifestRepository {
    root: PathBuf,
}
Expand description

Canonical filesystem-backed source for spec, shared, and item manifests.

Fields§

§root: PathBuf

Implementations§

Source§

impl ManifestRepository

Source

pub fn new(root: impl Into<PathBuf>) -> Self

Creates a repository rooted at the directory containing specs and items.toml.

Source

pub fn root(&self) -> &Path

Repository root.

Source

pub fn toml_paths(&self) -> Result<Vec<PathBuf>, ManifestLoadError>

Discovers every TOML document in the repository, sorted by path.

§Errors

Returns an error when the repository tree cannot be read.

Source

pub fn spec_paths(&self) -> Result<Vec<PathBuf>, ManifestLoadError>

Discovers every spec entry recursively, sorted by path.

§Errors

Returns an error when the repository tree cannot be read or contains no spec entries.

Source

pub fn spec_slug(&self, path: &Path) -> Result<String, ManifestLoadError>

Derives the public <specialization>_<class> slug from an entry path.

§Errors

Returns an error when path is outside the repository or is not a spec entry path.

Source

pub fn shared_paths(&self) -> Result<Vec<SharedManifestPath>, ManifestLoadError>

Discovers every class-shared manifest recursively, sorted by path.

§Errors

Returns an error when the repository tree cannot be read or a path cannot be normalized.

Source

pub fn load_spec(&self, path: &Path) -> Result<Manifest, ManifestLoadError>

Loads a spec entry, its ordered private parts, and its class-shared includes.

§Errors

Returns an error when any manifest cannot be read, composed, validated, or deserialized.

Source

pub fn load_items(&self) -> Result<ItemsManifest, ManifestLoadError>

Loads the repository’s item manifest.

§Errors

Returns an error when the item manifest cannot be read, validated, or deserialized.

Source

pub fn load_shared_bindings( &self, shared_path: &SharedManifestPath, ) -> Result<SharedBindings, ManifestLoadError>

Loads effect and reported-spell bindings from a discovered shared manifest.

§Errors

Returns an error when the shared manifest cannot be read or its sections are invalid.

Trait Implementations§

Source§

impl Clone for ManifestRepository

Source§

fn clone(&self) -> ManifestRepository

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ManifestRepository

Source§

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

Formats the value using the given formatter. 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> DynClone for T
where T: Clone,

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more