Struct git2::FetchOptions

source ·
pub struct FetchOptions<'cb> { /* private fields */ }
Expand description

Options which can be specified to various fetch operations.

Implementations§

source§

impl<'cb> FetchOptions<'cb>

source

pub fn new() -> FetchOptions<'cb>

Creates a new blank set of fetch options

source

pub fn remote_callbacks(&mut self, cbs: RemoteCallbacks<'cb>) -> &mut Self

Set the callbacks to use for the fetch operation.

source

pub fn proxy_options(&mut self, opts: ProxyOptions<'cb>) -> &mut Self

Set the proxy options to use for the fetch operation.

source

pub fn prune(&mut self, prune: FetchPrune) -> &mut Self

Set whether to perform a prune after the fetch.

source

pub fn update_fetchhead(&mut self, update: bool) -> &mut Self

Set whether to write the results to FETCH_HEAD.

Defaults to true.

source

pub fn depth(&mut self, depth: i32) -> &mut Self

Set fetch depth, a value less or equal to 0 is interpreted as pull everything (effectively the same as not declaring a limit depth).

source

pub fn download_tags(&mut self, opt: AutotagOption) -> &mut Self

Set how to behave regarding tags on the remote, such as auto-downloading tags for objects we’re downloading or downloading all of them.

The default is to auto-follow tags.

source

pub fn follow_redirects(&mut self, redirect: RemoteRedirect) -> &mut Self

Set remote redirection settings; whether redirects to another host are permitted.

By default, git will follow a redirect on the initial request (/info/refs), but not subsequent requests.

source

pub fn custom_headers(&mut self, custom_headers: &[&str]) -> &mut Self

Set extra headers for this fetch operation.

Trait Implementations§

source§

impl<'cb> Default for FetchOptions<'cb>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'cb> Freeze for FetchOptions<'cb>

§

impl<'cb> !RefUnwindSafe for FetchOptions<'cb>

§

impl<'cb> !Send for FetchOptions<'cb>

§

impl<'cb> !Sync for FetchOptions<'cb>

§

impl<'cb> Unpin for FetchOptions<'cb>

§

impl<'cb> !UnwindSafe for FetchOptions<'cb>

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

§

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>,

§

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.