Skip to main content

Package

Struct Package 

Source
pub struct Package<S: CoordSpec> { /* private fields */ }
Expand description

A handle to one file in a CoordView: authoritative coords (read from the columns) + its location. Bytes are lazy — Package::bytes.

Implementations§

Source§

impl<S: CoordSpec> Package<S>

Source

pub fn relative_path(&self) -> &str

This package’s row key in the archive — its relative_path column. What lets a caller holding a handle ask the lookup sub-index, or fold a path-bound per-file digest, without listing the whole archive.

Source

pub fn size(&self) -> u64

Uncompressed size in bytes (no decompression).

Source

pub fn bytes(&self) -> Result<Vec<u8>>

LAZY: pread + decompress the file’s bytes. The only I/O of the read API.

Source

pub fn into_bytes(self) -> Result<Vec<u8>>

Source§

impl Package<RustSpec>

Source

pub fn name(&self) -> &str

Authoritative crate name (from the crate_name column, not a path parse).

Source

pub fn version(&self) -> &str

Source§

impl Package<MavenSpec>

Source

pub fn group(&self) -> &str

Source

pub fn artifact(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn classifier(&self) -> Option<&str>

The classifier (sources, javadoc, …) or None for the primary artifact.

Source

pub fn coords(&self) -> (&str, &str, &str, Option<&str>)

(group, artifact, version, classifier?) — authoritative coords.

Source§

impl Package<PythonSpec>

Source

pub fn name(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn kind(&self) -> PythonKind

Wheel or sdist (derived from the matched row’s filename).

Source§

impl Package<NpmSpec>

Source

pub fn name(&self) -> &str

Authoritative package name (from the name column — includes @scope/).

Source

pub fn version(&self) -> &str

Source§

impl Package<GemSpec>

Source

pub fn name(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn platform(&self) -> &str

The gem platform (ruby default, e.g. java for a native gem).

Source§

impl Package<CondaSpec>

Source

pub fn name(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn build(&self) -> &str

The build string (e.g. py311h1234567_0), from info/index.json.

Source

pub fn subdir(&self) -> &str

The subdir/platform (e.g. linux-64), from info/index.json.

Source§

impl Package<RpmSpec>

Source

pub fn name(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn release(&self) -> &str

Source

pub fn arch(&self) -> &str

Source

pub fn epoch(&self) -> Option<&str>

The authoritative Epoch (from the header), or None when unset.

Source§

impl Package<DebSpec>

Source

pub fn name(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub fn arch(&self) -> &str

Source

pub fn control(&self) -> Option<&str>

The raw control stanza, or None when the .deb wasn’t parseable at ingest.

Auto Trait Implementations§

§

impl<S> Forget for Package<S>

§

impl<S> Freeze for Package<S>
where <S as CoordSpec>::Key: Freeze, <S as CoordSpec>::Extra: Freeze,

§

impl<S> Move for Package<S>

§

impl<S> RefUnwindSafe for Package<S>

§

impl<S> Send for Package<S>
where <S as CoordSpec>::Key: Send, <S as CoordSpec>::Extra: Send,

§

impl<S> Sync for Package<S>
where <S as CoordSpec>::Key: Sync, <S as CoordSpec>::Extra: Sync,

§

impl<S> Unpin for Package<S>
where <S as CoordSpec>::Key: Unpin, <S as CoordSpec>::Extra: Unpin,

§

impl<S> UnsafeUnpin for Package<S>

§

impl<S> UnwindSafe for Package<S>
where <S as CoordSpec>::Key: UnwindSafe, <S as CoordSpec>::Extra: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.