pub struct PrepareFetch { /* private fields */ }
Expand description

A utility to collect configuration on how to fetch from a remote and initiate a fetch operation. It will delete the newly created repository on when dropped without successfully finishing a fetch.

Implementations

Modification

Available on crate feature blocking-network-client only.

Fetch a pack and update local branches according to refspecs, providing progress and checking should_interrupt to stop the operation. On success, the persisted repository is returned, and this method must not be called again to avoid a panic. On error, the method may be called again to retry as often as needed.

If the remote repository was empty, that is newly initialized, the returned repository will also be empty and like it was newly initialized.

Note that all data we created will be removed once this instance drops if the operation wasn’t successful.

Available on crate feature blocking-network-client only.

Similar to fetch_only(), but passes ownership to a utility type to configure a checkout operation.

Builder

Available on crate features async-network-client or blocking-network-client only.

Set additional options to adjust parts of the fetch operation that are not affected by the git configuration.

Use f to apply arbitrary changes to the remote that is about to be used to fetch a pack.

The passed in remote will be un-named and pre-configured to be a default remote as we know it from git-clone. It is not yet present in the configuration of the repository, but each change it will eventually be written to the configuration prior to performing a the fetch operation.

Set the remote’s name to the given value after it was configured using the function provided via configure_remote().

If not set here, it defaults to origin or the value of clone.defaultRemoteName.

Consumption

Persist the contained repository as is even if an error may have occurred when fetching from the remote.

Instantiation

Create a new repository at path with crate_opts which is ready to clone from url, possibly after making additional adjustments to configuration and settings.

Note that this is merely a handle to perform the actual connection to the remote, and if any of it fails the freshly initialized repository will be removed automatically as soon as this instance drops.

Trait Implementations

Executes the destructor for this type. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.