Trait gix_ref::file::ReferenceExt
source · pub trait ReferenceExt: Sealed {
// Required methods
fn log_iter<'a, 's>(&'a self, store: &'s Store) -> Platform<'a, 's>;
fn log_exists(&self, store: &Store) -> bool;
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_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 follow(&self, store: &Store) -> Option<Result<Reference, Error>>;
fn follow_packed(
&self,
store: &Store,
packed: Option<&Buffer>
) -> Option<Result<Reference, Error>>;
}
Expand description
A trait to extend Reference with functionality requiring a file::Store.
Required Methods§
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.
sourcefn follow(&self, store: &Store) -> Option<Result<Reference, Error>>
fn follow(&self, store: &Store) -> Option<Result<Reference, Error>>
Follow this symbolic reference one level and return the ref it refers to.
Returns None
if this is not a symbolic reference, hence the leaf of the chain.
sourcefn follow_packed(
&self,
store: &Store,
packed: Option<&Buffer>
) -> Option<Result<Reference, Error>>
fn follow_packed( &self, store: &Store, packed: Option<&Buffer> ) -> Option<Result<Reference, Error>>
Follow this symbolic reference one level and return the ref it refers to,
possibly providing access to packed
references for lookup if it contains the referent.
Returns None
if this is not a symbolic reference, hence the leaf of the chain.