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 Ord for Reference
impl Ord for Reference
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more