use-git-oid 0.0.1

Primitive Git object identifier vocabulary for RustUse
Documentation
  • Coverage
  • 92%
    23 out of 25 items documented1 out of 16 items with examples
  • Size
  • Source code size: 12.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 636.52 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-git
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-git-oid

Primitive Git object identifier vocabulary for RustUse.

use-git-oid validates object identifier text and models SHA-1 and future-friendly SHA-256 shapes. It does not hash content, read object storage, or resolve objects.

Basic usage

use use_git_oid::{GitOid, GitOidKind, ShortGitOid};

let oid = GitOid::new("0123456789abcdef0123456789abcdef01234567").expect("valid oid");
let short = ShortGitOid::new("0123456").expect("valid short oid");

assert_eq!(oid.kind(), GitOidKind::Sha1);
assert_eq!(short.as_str(), "0123456");

Scope

  • Validate hexadecimal identifier text.
  • Distinguish full and short object identifier shapes.
  • Keep hashing and object lookup out of scope.