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 peel_to_id_in_place()
was called.
Implementations
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
sourcefn 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
sourceimpl Ord for Reference
impl Ord for Reference
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Reference> for Reference
impl PartialOrd<Reference> for Reference
sourcefn partial_cmp(&self, other: &Reference) -> Option<Ordering>
fn partial_cmp(&self, other: &Reference) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl ReferenceExt for Reference
impl ReferenceExt for Reference
sourcefn 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.
sourcefn log_exists(&self, store: &Store) -> bool
fn log_exists(&self, store: &Store) -> bool
For details, see Reference::log_exists().
sourcefn peel_to_id_in_place<E: Error + Send + Sync + 'static>(
&mut self,
store: &Store,
find: impl FnMut(ObjectId, &mut Vec<u8>) -> Result<Option<(Kind, &[u8])>, E>
) -> Result<ObjectId, Error>
fn peel_to_id_in_place<E: Error + Send + Sync + 'static>(
&mut self,
store: &Store,
find: impl FnMut(ObjectId, &mut Vec<u8>) -> Result<Option<(Kind, &[u8])>, E>
) -> Result<ObjectId, Error>
For details, see Reference::peel_to_id_in_place().
sourcefn peel_to_id_in_place_packed<E: Error + Send + Sync + 'static>(
&mut self,
store: &Store,
find: impl FnMut(ObjectId, &mut Vec<u8>) -> Result<Option<(Kind, &[u8])>, E>,
packed: Option<&Buffer>
) -> Result<ObjectId, Error>
fn peel_to_id_in_place_packed<E: Error + Send + Sync + 'static>(
&mut self,
store: &Store,
find: impl FnMut(ObjectId, &mut Vec<u8>) -> Result<Option<(Kind, &[u8])>, E>,
packed: Option<&Buffer>
) -> Result<ObjectId, Error>
For details, see Reference::peel_to_id_in_place(), with support for a known stable packed buffer.
impl Eq for Reference
impl StructuralEq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more