#[repr(u8)]pub enum SWHType {
Content = 0,
Directory = 1,
Origin = 2,
Release = 3,
Revision = 4,
Snapshot = 5,
}
Expand description
Variants§
Content = 0
Directory = 1
a list of named directory entries, each of which pointing to other artifacts, usually file contents or sub-directories. Directory entries are also associated to some metadata stored as permission bits.
Origin = 2
code “hosting places” as previously described are usually large platforms that host several unrelated software projects. For software provenance purposes it is important to be more specific than that.
Software origins are fine grained references to where source code
artifacts archived by Software Heritage have been retrieved from. They
take the form of (type, url)
pairs, where url is a canonical URL
(e.g., the address at which one can git clone
a repository or download
a source tarball) and type
the kind of software origin (e.g., git,
svn, or dsc for Debian source packages).
Release = 3
AKA “tags”
some revisions are more equals than others and get selected by developers as denoting important project milestones known as “releases”. Each release points to the last commit in project history corresponding to the release and carries metadata: release name and version, release message, cryptographic signatures, etc.
Revision = 4
AKA commits
Software development within a specific project is essentially a time-indexed series of copies of a single “root” directory that contains the entire project source code. Software evolves when a d eveloper modifies the content of one or more files in that directory and record their changes.
Each recorded copy of the root directory is known as a “revision”. It points to a fully-determined directory and is equipped with arbitrary metadata. Some of those are added manually by the developer (e.g., commit message), others are automatically synthesized (timestamps, preceding commit(s), etc).
Snapshot = 5
any kind of software origin offers multiple pointers to the “current” state of a development project. In the case of VCS this is reflected by branches (e.g., master, development, but also so called feature branches dedicated to extending the software in a specific direction); in the case of package distributions by notions such as suites that correspond to different maturity levels of individual packages (e.g., stable, development, etc.).
A “snapshot” of a given software origin records all entry points found there and where each of them was pointing at the time. For example, a snapshot object might track the commit where the master branch was pointing to at any given time, as well as the most recent release of a given package in the stable suite of a FOSS distribution.
Implementations§
source§impl SWHType
impl SWHType
sourcepub const NUMBER_OF_TYPES: usize = 6usize
pub const NUMBER_OF_TYPES: usize = 6usize
Get the number of possible types.
To avoid having to update this when adding a new type
we can use the unstable function std::mem::variant_count
or the variant_count
crate.
But for now we just hardcode it while we decide how to
deal with this.
Trait Implementations§
source§impl PartialEq for SWHType
impl PartialEq for SWHType
impl Copy for SWHType
impl Eq for SWHType
impl StructuralEq for SWHType
impl StructuralPartialEq for SWHType
Auto Trait Implementations§
impl RefUnwindSafe for SWHType
impl Send for SWHType
impl Sync for SWHType
impl Unpin for SWHType
impl UnwindSafe for SWHType
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
§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere U: CastableFrom<T>,
§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere U: DowncastableFrom<T>,
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.