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 peel_to_id_in_place()
was called.
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<Reference> for Reference
impl PartialEq<Reference> for Reference
source§impl PartialOrd<Reference> for Reference
impl PartialOrd<Reference> 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<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()
.source§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>
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§
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