Skip to main content

ReferenceObservation

Struct ReferenceObservation 

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

A read-only reference package whose manifest matches its selected lock identity.

Local and registry contents are observations of the supplied contained Tree, not archive authentication. Git contents require the sealed committed backend. The loaded workspace deliberately retains no locked bindings, configured dependency edges or preferred-provider admission.

Implementations§

Source§

impl ReferenceObservation

Source

pub fn local_root( catalog: &LockedCatalog, tree: &dyn Tree, manifest: &RelPath, options: &LoadOptions, ) -> Result<Self, LoadError>

Observe one actual local root package and associate its explicit or inherited version with a unique source-less lock row. This is the owning manifest context for subsequent declaration-qualified reference requests.

§Errors

Refuses missing/ambiguous lock identity, invalid inheritance and bounded source failures. No provider admission is retained.

Source

pub fn load( request: &ReferenceRequest<'_>, tree: &dyn Tree, manifest: &RelPath, options: &LoadOptions, ) -> Result<Self, LoadError>

Observe a local or registry package through the ordinary bounded source loader. The manifest is relative to the supplied Tree, whose root must retain any workspace manifest needed for inherited package fields.

§Errors

Refuses unresolved declarations, Git rows, mismatched manifests, extra packages, invalid inheritance and all ordinary source/containment limits.

Source

pub fn committed( request: &ReferenceRequest<'_>, tree: &CommittedGitTree<'_>, manifest: &RelPath, options: &LoadOptions, ) -> Result<Self, LoadError>

Observe the exact committed source selected by the declaration and lock row.

The returned workspace usage includes the protocol, listing and blob work of this observation under its original selection/source allowance. The caller’s prior construction of the supplied Tree precedes this operation.

§Errors

Refuses a different committed source and all bounded source/identity failures.

Source

pub const fn workspace(&self) -> &Workspace

Parsed source and declarations, without provider-admitted locked bindings.

Source

pub const fn package(&self) -> PackageId

The selected package within this observation’s own workspace.

Source

pub const fn row(&self) -> LockedPackageId

Selected identity within the request’s catalog.

Source

pub fn name(&self) -> &str

Manifest-verified Cargo package name.

Source

pub fn version(&self) -> &str

Actual explicit or inherited manifest version.

Source

pub const fn source(&self) -> Option<&LockedSource>

Complete external lock source, absent for a local path package.

Source

pub const fn checksum(&self) -> Option<&[u8; 32]>

Recorded registry archive checksum; this does not authenticate a supplied Tree.

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.