pub struct Reference {
pub name: FullName,
pub target: Target,
pub peeled: Option<ObjectId>,
}Expand description
A fully owned backend agnostic reference
Fields§
§name: FullNameThe path to uniquely identify this ref within its store.
target: TargetThe target of the reference, either a symbolic reference by full name or a possibly intermediate object by its id.
peeled: Option<ObjectId>The fully peeled object to which this reference ultimately points to after following all symbolic refs and all annotated
tags. Only guaranteed to be set after
Reference::peel_to_id() was called or if this reference originated
from a packed ref.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn name_without_namespace(
&self,
namespace: &Namespace,
) -> Option<&FullNameRef>
pub fn name_without_namespace( &self, namespace: &Namespace, ) -> Option<&FullNameRef>
Return the full validated name of the reference, with the given namespace stripped if possible.
If the reference name wasn’t prefixed with namespace, None is returned instead.
Sourcepub fn strip_namespace(&mut self, namespace: &Namespace) -> &mut Self
pub fn strip_namespace(&mut self, namespace: &Namespace) -> &mut Self
Strip the given namespace from our name as well as the name, but not the reference we point to.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
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>,
Source§impl Ord for Reference
impl Ord for Reference
Source§impl PartialOrd for Reference
impl PartialOrd for Reference
Source§impl ReferenceExt for Reference
impl ReferenceExt for Reference
Source§fn log_iter<'a, 's>(&'a self, store: &'s Store) -> Platform<'a, 's>
fn log_iter<'a, 's>(&'a self, store: &'s Store) -> Platform<'a, 's>
Source§fn log_exists(&self, store: &Store) -> bool
fn log_exists(&self, store: &Store) -> bool
Reference::log_exists().Source§fn peel_to_id_in_place(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>
fn peel_to_id_in_place( &mut self, store: &Store, objects: &dyn Find, ) -> Result<ObjectId, Error>
Use peel_to_id() instead
objects to access them and store to lookup symbolic references. Read moreSource§fn peel_to_id(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>
fn peel_to_id( &mut self, store: &Store, objects: &dyn Find, ) -> Result<ObjectId, Error>
objects to access them and store to lookup symbolic references. Read moreSource§fn peel_to_id_in_place_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn peel_to_id_in_place_packed( &mut self, store: &Store, objects: &dyn Find, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
Use peel_to_id_packed() instead
ReferenceExt::peel_to_id_in_place(), but with support for a known stable packed buffer
to use for resolving symbolic links.Source§fn peel_to_id_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn peel_to_id_packed( &mut self, store: &Store, objects: &dyn Find, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
ReferenceExt::peel_to_id(), but with support for a known stable packed buffer to
use for resolving symbolic links.Source§fn follow_to_object_in_place_packed(
&mut self,
store: &Store,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn follow_to_object_in_place_packed( &mut self, store: &Store, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
Use follow_to_object_packed() instead
ReferenceExt::follow(), but follows all symbolic references while gracefully handling loops,
altering this instance in place.Source§fn follow_to_object_packed(
&mut self,
store: &Store,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn follow_to_object_packed( &mut self, store: &Store, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
ReferenceExt::follow(), but follows all symbolic references while gracefully handling loops,
altering this instance in place.