pub struct Reference {
pub name: FullName,
pub target: Target,
pub peeled: Option<ObjectId>,
}
Expand description
A fully owned backend agnostic reference
Fields§
§name: FullName
The path to uniquely identify this ref within its store.
target: Target
The 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. Only guaranteed to be set after
Reference::peel_to_id_in_place()
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Reference
impl Ord for Reference
source§impl PartialEq for Reference
impl PartialEq for Reference
source§impl PartialOrd for Reference
impl PartialOrd for Reference
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 moresource§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>
A step towards obtaining forward or reverse iterators on reference logs.
source§fn log_exists(&self, store: &Store) -> bool
fn log_exists(&self, store: &Store) -> bool
For details, see
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>
Follow all symbolic targets this reference might point to and peel the underlying object
to the end of the chain, and return it, using
objects
to access them. 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>
Like
ReferenceExt::peel_to_id_in_place()
, but with support for a known stable packed buffer
to use for resolving symbolic links.impl Eq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more