pub struct Repository { /* private fields */ }Expand description
A located repository with its manifest read.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn discover(start: &Path) -> Result<Self, Error>
pub fn discover(start: &Path) -> Result<Self, Error>
Walk from start upward to the nearest directory carrying MANIFEST. A manifest
that does not parse stops the search with its error: a nearer broken layer is never
skipped in favour of a farther working one.
Sourcepub fn manifest_value(&self) -> Result<Value, Error>
pub fn manifest_value(&self) -> Result<Value, Error>
The manifest as a JSON value, for schema validation.
Sourcepub fn section_path(&self, name: &str) -> Option<String>
pub fn section_path(&self, name: &str) -> Option<String>
The repository-relative path of a section, e.g. .ai/repo/rules, or None when
the manifest does not name it.
Sourcepub fn local_path(&self) -> String
pub fn local_path(&self) -> String
The repository-relative path of the checkout-local half, never a source.
Sourcepub fn section_of(&self, rel_path: &str) -> Option<&str>
pub fn section_of(&self, rel_path: &str) -> Option<&str>
The manifest section a repository-relative path falls under, by longest prefix.
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnsafeUnpin for Repository
impl UnwindSafe for Repository
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
Mutably borrows from an owned value. Read more