pub struct AnnotatedTag { /* private fields */ }Expand description
A byte-exact annotated Git tag object.
body is the unframed body returned by git cat-file tag. It retains the
tagger identity and timezone, message, and any appended signature verbatim.
target_tag links an outer tag to the native CAS object for an inner tag;
the eventual commit target is represented by marker.peeled_state on the
outermost object. Construct and decode reject a Git target that disagrees
with target_tag; export binds peeled_state to the mapped commit.
Implementations§
Source§impl AnnotatedTag
impl AnnotatedTag
Sourcepub fn new(
git_format: ObjectFormat,
body: Vec<u8>,
target_tag: Option<ContentHash>,
marker: Option<AnnotatedTagMarker>,
) -> Result<AnnotatedTag, AnnotatedTagError>
pub fn new( git_format: ObjectFormat, body: Vec<u8>, target_tag: Option<ContentHash>, marker: Option<AnnotatedTagMarker>, ) -> Result<AnnotatedTag, AnnotatedTagError>
Build a validated native tag object from exact Git tag bytes.
Sourcepub fn decode_current_msgpack(
bytes: &[u8],
) -> Result<AnnotatedTag, AnnotatedTagError>
pub fn decode_current_msgpack( bytes: &[u8], ) -> Result<AnnotatedTag, AnnotatedTagError>
Decode and validate the current durable msgpack representation.
Sourcepub fn encode_current_msgpack(&self) -> Vec<u8> ⓘ
pub fn encode_current_msgpack(&self) -> Vec<u8> ⓘ
Encode the versioned durable representation used by loose objects and packs.
Sourcepub fn hash(&self) -> ContentHash
pub fn hash(&self) -> ContentHash
Native content address of this complete record.
Sourcepub fn git_format(&self) -> Result<ObjectFormat, AnnotatedTagError>
pub fn git_format(&self) -> Result<ObjectFormat, AnnotatedTagError>
Git object format used to parse and hash this tag.
Sourcepub fn git_oid(&self) -> Result<ObjectId, AnnotatedTagError>
pub fn git_oid(&self) -> Result<ObjectId, AnnotatedTagError>
Original Git object id, computed from tag <len>\0<body>.
Sourcepub fn git_target(&self) -> Result<ObjectId, AnnotatedTagError>
pub fn git_target(&self) -> Result<ObjectId, AnnotatedTagError>
Git object named by this tag body (object <oid>).
Sourcepub fn git_target_type(&self) -> Result<ObjectType, AnnotatedTagError>
pub fn git_target_type(&self) -> Result<ObjectType, AnnotatedTagError>
Git object type named by this tag body (type commit / type tag).
Sourcepub fn target_tag(&self) -> Option<ContentHash>
pub fn target_tag(&self) -> Option<ContentHash>
Native CAS link to an inner tag object for tag-of-tag chains.
Sourcepub fn marker(&self) -> Option<&AnnotatedTagMarker>
pub fn marker(&self) -> Option<&AnnotatedTagMarker>
Marker binding carried only by the outermost tag object.
Sourcepub fn bind_target_tag(
&self,
inner: &AnnotatedTag,
) -> Result<(), AnnotatedTagError>
pub fn bind_target_tag( &self, inner: &AnnotatedTag, ) -> Result<(), AnnotatedTagError>
Prove inner is the native object this tag’s Git target names.
Trait Implementations§
Source§impl Clone for AnnotatedTag
impl Clone for AnnotatedTag
Source§fn clone(&self) -> AnnotatedTag
fn clone(&self) -> AnnotatedTag
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more