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(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>;
fn peel_to_id(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>;
fn peel_to_id_in_place_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>;
fn peel_to_id_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>;
fn follow_to_object_in_place_packed(
&mut self,
store: &Store,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>;
fn follow_to_object_packed(
&mut self,
store: &Store,
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(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>
๐Deprecated: Use peel_to_id() instead
fn peel_to_id_in_place( &mut self, store: &Store, objects: &dyn Find, ) -> Result<ObjectId, Error>
peel_to_id() insteadFollow all symbolic targets this reference might point to and peel the underlying object
to the end of the tag-chain, returning the first non-tag object the annotated tag points to,
using objects to access them and store to lookup symbolic references.
This is useful to learn where this reference is ultimately pointing to after following all symbolic refs and all annotated tags to the first non-tag object.
Sourcefn peel_to_id(
&mut self,
store: &Store,
objects: &dyn Find,
) -> Result<ObjectId, Error>
fn peel_to_id( &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 tag-chain, returning the first non-tag object the annotated tag points to,
using objects to access them and store to lookup symbolic references.
This is useful to learn where this reference is ultimately pointing to after following all symbolic refs and all annotated tags to the first non-tag object.
Note that this method mutates self in place if it does not already point to a
non-symbolic object.
Sourcefn peel_to_id_in_place_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
๐Deprecated: Use peel_to_id_packed() instead
fn peel_to_id_in_place_packed( &mut self, store: &Store, objects: &dyn Find, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
peel_to_id_packed() insteadLike ReferenceExt::peel_to_id_in_place(), but with support for a known stable packed buffer
to use for resolving symbolic links.
Sourcefn peel_to_id_packed(
&mut self,
store: &Store,
objects: &dyn Find,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn peel_to_id_packed( &mut self, store: &Store, objects: &dyn Find, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
Like ReferenceExt::peel_to_id(), but with support for a known stable packed buffer to
use for resolving symbolic links.
Sourcefn follow_to_object_in_place_packed(
&mut self,
store: &Store,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
๐Deprecated: Use follow_to_object_packed() instead
fn follow_to_object_in_place_packed( &mut self, store: &Store, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
follow_to_object_packed() insteadLike ReferenceExt::follow(), but follows all symbolic references while gracefully handling loops,
altering this instance in place.
Sourcefn follow_to_object_packed(
&mut self,
store: &Store,
packed: Option<&Buffer>,
) -> Result<ObjectId, Error>
fn follow_to_object_packed( &mut self, store: &Store, packed: Option<&Buffer>, ) -> Result<ObjectId, Error>
Like ReferenceExt::follow(), but follows all symbolic references while gracefully handling loops,
altering this instance in place.
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.