EntryRef

Struct EntryRef 

Source
pub struct EntryRef<'repo, 'a> {
    pub inner: EntryRef<'a>,
    pub repo: &'repo Repository,
}
Expand description

An entry within a tree

Fields§

§inner: EntryRef<'a>

The actual entry ref we are wrapping.

§repo: &'repo Repository

The owning repository.

Implementations§

Source§

impl<'repo, 'a> EntryRef<'repo, 'a>

Source

pub fn mode(&self) -> EntryMode

The kind of object to which id() is pointing.

Source

pub fn kind(&self) -> EntryKind

The kind of object to which id() is pointing, as shortcut to self.mode().kind().

Source

pub fn filename(&self) -> &BStr

The name of the file in the parent tree.

Source

pub fn id(&self) -> Id<'repo>

Return the entries id, connected to the underlying repository.

Source

pub fn oid(&self) -> &oid

Return the plain object id of this entry, without access to the repository.

Source

pub fn object(&self) -> Result<Object<'repo>, Error>

Return the object this entry points to.

Source

pub fn object_id(&self) -> ObjectId

Return the plain object id of this entry, without access to the repository.

Source

pub fn detach(&self) -> EntryRef<'a>

Detach the repository from this instance.

Source

pub fn to_owned(&self) -> Entry<'repo>

Create an instance that doesn’t bind to a buffer anymore (but that still contains a repository reference).

Trait Implementations§

Source§

impl Display for EntryRef<'_, '_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'repo, 'a> Freeze for EntryRef<'repo, 'a>

§

impl<'repo, 'a> !RefUnwindSafe for EntryRef<'repo, 'a>

§

impl<'repo, 'a> !Send for EntryRef<'repo, 'a>

§

impl<'repo, 'a> !Sync for EntryRef<'repo, 'a>

§

impl<'repo, 'a> Unpin for EntryRef<'repo, 'a>

§

impl<'repo, 'a> !UnwindSafe for EntryRef<'repo, 'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,