pub struct Arguments { /* private fields */ }
Available on crate features blocking-client or async-client only.
Expand description

The arguments passed to a server command.

Implementations§

source§

impl Arguments

source

pub fn send<'a, T: Transport + 'a>( &mut self, transport: &'a mut T, add_done_argument: bool ) -> Result<Box<dyn ExtendedBufRead + Unpin + 'a>, Error>

Available on crate feature blocking-client only.

Send fetch arguments to the server, and indicate this is the end of negotiations only if add_done_argument is present.

source§

impl Arguments

source

pub fn is_empty(&self) -> bool

Return true if there is no argument at all.

This can happen if callers assure that they won’t add ‘wants’ if their ‘have’ is the same, i.e. if the remote has nothing new for them.

source

pub fn can_use_filter(&self) -> bool

Return true if ref filters is supported.

source

pub fn can_use_shallow(&self) -> bool

Return true if shallow refs are supported.

This is relevant for partial clones when using --depth X.

source

pub fn can_use_deepen(&self) -> bool

Return true if the ‘deepen’ capability is supported.

This is relevant for partial clones when using --depth X and retrieving additional history.

source

pub fn can_use_deepen_since(&self) -> bool

Return true if the ‘deepen_since’ capability is supported.

This is relevant for partial clones when using --depth X and retrieving additional history based on a date beyond which all history should be present.

source

pub fn can_use_deepen_not(&self) -> bool

Return true if the ‘deepen_not’ capability is supported.

This is relevant for partial clones when using --depth X.

source

pub fn can_use_deepen_relative(&self) -> bool

Return true if the ‘deepen_relative’ capability is supported.

This is relevant for partial clones when using --depth X.

source

pub fn can_use_ref_in_want(&self) -> bool

Return true if the ‘ref-in-want’ capability is supported.

This can be used to bypass ‘ls-refs’ entirely in protocol v2.

source

pub fn can_use_include_tag(&self) -> bool

Return true if the ‘include-tag’ capability is supported.

source

pub fn want(&mut self, id: impl AsRef<oid>)

Add the given id pointing to a commit to the ‘want’ list.

As such it should be included in the server response as it’s not present on the client.

source

pub fn want_ref(&mut self, ref_path: &BStr)

Add the given ref to the ‘want-ref’ list.

The server should respond with a corresponding ‘wanted-refs’ section if it will include the wanted ref in the packfile response.

source

pub fn have(&mut self, id: impl AsRef<oid>)

Add the given id pointing to a commit to the ‘have’ list.

As such it should not be included in the server response as it’s already present on the client.

source

pub fn shallow(&mut self, id: impl AsRef<oid>)

Add the given id pointing to a commit to the ‘shallow’ list.

source

pub fn deepen(&mut self, depth: usize)

Deepen the commit history by depth amount of commits.

source

pub fn deepen_since(&mut self, seconds_since_unix_epoch: usize)

Deepen the commit history to include all commits from now to seconds_since_unix_epoch.

source

pub fn deepen_relative(&mut self)

Deepen the commit history in a relative instead of absolute fashion.

source

pub fn deepen_not(&mut self, ref_path: &BStr)

Do not include commits reachable by the given ref_path when deepening the history.

source

pub fn filter(&mut self, spec: &str)

Set the given filter spec when listing references.

source

pub fn use_include_tag(&mut self)

Permanently allow the server to include tags that point to commits or objects it would return.

Needs to only be called once.

source

pub fn new(version: Protocol, features: Vec<Feature>) -> Self

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

Create a new instance to help setting up arguments to send to the server as part of a fetch operation for which features are the available and configured features to use.

Trait Implementations§

source§

impl Debug for Arguments

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.