Skip to main content

AnnotatedTag

Struct AnnotatedTag 

Source
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

Source

pub fn new( git_format: GitObjectFormat, body: Vec<u8>, target_tag: Option<ContentHash>, marker: Option<AnnotatedTagMarker>, ) -> Result<Self, AnnotatedTagError>

Build a validated native tag object from exact Git tag bytes.

Source

pub fn decode_current_msgpack(bytes: &[u8]) -> Result<Self, AnnotatedTagError>

Decode and validate the current durable msgpack representation.

Source

pub fn encode_current_msgpack(&self) -> Vec<u8>

Encode the versioned durable representation used by loose objects and packs.

Source

pub fn hash(&self) -> ContentHash

Native content address of this complete record.

Source

pub fn body(&self) -> &[u8]

Exact unframed Git tag-object body.

Source

pub fn git_format(&self) -> Result<GitObjectFormat, AnnotatedTagError>

Git object format used to parse and hash this tag.

Source

pub fn git_oid(&self) -> Result<GitObjectId, AnnotatedTagError>

Original Git object id, computed from tag <len>\0<body>.

Source

pub fn git_target(&self) -> Result<GitObjectId, AnnotatedTagError>

Git object named by this tag body (object <oid>).

Source

pub fn git_target_type(&self) -> Result<GitObjectType, AnnotatedTagError>

Git object type named by this tag body (type commit / type tag).

Source

pub fn target_tag(&self) -> Option<ContentHash>

Native CAS link to an inner tag object for tag-of-tag chains.

Source

pub fn marker(&self) -> Option<&AnnotatedTagMarker>

Marker binding carried only by the outermost tag object.

Source

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

Source§

fn clone(&self) -> AnnotatedTag

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnnotatedTag

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AnnotatedTag

Source§

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 Eq for AnnotatedTag

Source§

impl PartialEq for AnnotatedTag

Source§

fn eq(&self, other: &AnnotatedTag) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AnnotatedTag

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AnnotatedTag

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.