Expand description
§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.
Structs§
- GitOid
- A full
Gitobject identifier. - Short
GitOid - A short object identifier prefix.
Enums§
- GitOid
Kind - Supported
Gitobject identifier text shapes. - GitOid
Parse Error - Error returned while parsing object identifier text.