pub struct TagRef<'a> {
pub object: ObjectId,
pub object_type: ObjectType,
pub name: &'a [u8],
pub tagger: Option<&'a [u8]>,
pub message: &'a [u8],
pub raw_body: Option<&'a [u8]>,
}Expand description
A borrowed parse-view of a raw annotated tag object.
The tag name, tagger identity, and message slices point into the original
tag body. The object id and object type are parsed into owned values while
preserving the same validation behavior as Tag::parse. Like Tag,
this is a parsed canonical view of known fields rather than a byte-lossless
view of every raw header.
Fields§
§object: ObjectId§object_type: ObjectType§name: &'a [u8]§tagger: Option<&'a [u8]>§message: &'a [u8]§raw_body: Option<&'a [u8]>Implementations§
Source§impl<'a> TagRef<'a>
impl<'a> TagRef<'a>
pub fn parse(format: ObjectFormat, bytes: &'a [u8]) -> Result<Self>
pub fn to_owned(&self) -> Tag
Sourcepub fn tagger_signature(&self) -> Option<Signature>
pub fn tagger_signature(&self) -> Option<Signature>
Parse the raw tagger line into a typed Signature
parse-view.
Returns None when the tag has no tagger header or when the stored
bytes are not a well-formed git identity — callers that need to tell
those apart should inspect Tag::tagger directly. This is a read-only
lens over the raw bytes, which stay the source of truth for
Tag::write; the returned signature re-serializes byte-identically to
the stored tagger line.