Skip to main content

LinkDecoder

Struct LinkDecoder 

Source
pub struct LinkDecoder<'scratch> { /* private fields */ }
Expand description

Scan one canonical object body across arbitrary chunks. Blobs/messages are skipped without retaining them; commit parents and tag targets are emitted with their expected kinds. Tree names borrow caller scratch until resumption. Scratch is divided equally into current/previous names; other kinds need none.

This scans syntax and adjacent tree order, not complete graph validity. Authenticate the body separately with ObjectDigest. The host MUST check target existence/kinds and tree-name uniqueness (including file/directory aliases separated in Git order), persist parent edges and enforce ref policy. Gitlinks name external repositories and emit kind: None.

Historical noncanonical tree modes with recognized type bits, including zero padding and old regular-file permissions, are preserved and flagged. They are not silently rewritten or rejected as graph errors.

Implementations§

Source§

impl<'scratch> LinkDecoder<'scratch>

Source

pub fn new( info: ObjectInfo, format: ObjectFormat, names: &'scratch mut [u8], limits: LinkLimits, ) -> Result<Self>

Source

pub fn position(&self) -> u64

Source

pub fn update<'name>( &'name mut self, input: &[u8], end_of_input: bool, ) -> Result<LinkProgress<'name>>

Events may consume a prefix. Resubmit the suffix with the same EOF flag. Every error is terminal; all emitted metadata remains provisional.

Source

pub fn finish(&self) -> Result<()>

Auto Trait Implementations§

§

impl<'scratch> !UnwindSafe for LinkDecoder<'scratch>

§

impl<'scratch> Freeze for LinkDecoder<'scratch>

§

impl<'scratch> RefUnwindSafe for LinkDecoder<'scratch>

§

impl<'scratch> Send for LinkDecoder<'scratch>

§

impl<'scratch> Sync for LinkDecoder<'scratch>

§

impl<'scratch> Unpin for LinkDecoder<'scratch>

§

impl<'scratch> UnsafeUnpin for LinkDecoder<'scratch>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.