Struct git_object::TagRef
source · pub struct TagRef<'a> {
pub target: &'a BStr,
pub target_kind: Kind,
pub name: &'a BStr,
pub tagger: Option<SignatureRef<'a>>,
pub message: &'a BStr,
pub pgp_signature: Option<&'a BStr>,
}
Expand description
Represents a git tag, commonly indicating a software release.
Fields§
§target: &'a BStr
The hash in hexadecimal being the object this tag points to. Use target()
to obtain a byte representation.
target_kind: Kind
The kind of object that target
points to.
name: &'a BStr
The name of the tag, e.g. “v1.0”.
tagger: Option<SignatureRef<'a>>
The author of the tag.
message: &'a BStr
The message describing this release.
pgp_signature: Option<&'a BStr>
A cryptographic signature over the entire content of the serialized tag object thus far.
Implementations§
source§impl<'a> TagRef<'a>
impl<'a> TagRef<'a>
sourcepub fn from_bytes(data: &'a [u8]) -> Result<TagRef<'a>, Error>
pub fn from_bytes(data: &'a [u8]) -> Result<TagRef<'a>, Error>
Deserialize a tag from data
.
Examples found in repository?
More examples
sourcepub fn target(&self) -> ObjectId
pub fn target(&self) -> ObjectId
The object this tag points to as Id
.
Examples found in repository?
src/tag/write.rs (line 86)
85 86 87 88 89 90 91 92 93 94 95 96
fn size(&self) -> usize {
b"object".len() + 1 /* space */ + self.target().kind().len_in_hex() + 1 /* nl */
+ b"type".len() + 1 /* space */ + self.target_kind.as_bytes().len() + 1 /* nl */
+ b"tag".len() + 1 /* space */ + self.name.len() + 1 /* nl */
+ self
.tagger
.as_ref()
.map(|t| b"tagger".len() + 1 /* space */ + t.size() + 1 /* nl */)
.unwrap_or(0)
+ 1 /* nl */ + self.message.len()
+ self.pgp_signature.as_ref().map(|m| 1 /* nl */ + m.len()).unwrap_or(0)
}
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for TagRef<'a>
impl<'de: 'a, 'a> Deserialize<'de> for TagRef<'a>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> Ord for TagRef<'a>
impl<'a> Ord for TagRef<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<TagRef<'a>> for TagRef<'a>
impl<'a> PartialEq<TagRef<'a>> for TagRef<'a>
source§impl<'a> PartialOrd<TagRef<'a>> for TagRef<'a>
impl<'a> PartialOrd<TagRef<'a>> for TagRef<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more