Skip to main content

Checkout

Struct Checkout 

Source
pub struct Checkout<'a, S> { /* private fields */ }
Expand description

Builder for git checkout.

S encodes whether a target has been chosen. Only Checkout<_, WithTarget> exposes status() / Build, so failing to specify a target is a compile error.

See git checkout --help for full documentation.

Implementations§

Source§

impl<'a, S> Checkout<'a, S>

Source

pub fn repo_path(self, path: &'a Path) -> Self

Set the repository path (-C <path>).

Source§

impl<'a> Checkout<'a, NoTarget>

Source

pub fn commit_ish( self, commit_ish: impl Into<CommitIsh<'a>>, ) -> Checkout<'a, WithTarget<'a>>

Select the commit-ish to check out.

Source§

impl<'a> Checkout<'a, WithTarget<'a>>

Source

pub async fn status(self) -> Result<(), CommandError>

Execute the command and return the exit status.

Trait Implementations§

Source§

impl<'a> Build for Checkout<'a, WithTarget<'a>>

Source§

fn build(self) -> Command

Build the command without executing it.
Source§

impl<'a, S: Debug> Debug for Checkout<'a, S>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a, S> RepoPath<'a> for Checkout<'a, S>

Source§

fn repo_path(self, path: &'a Path) -> Self

Set the repository path (-C <path>).

Auto Trait Implementations§

§

impl<'a, S> Freeze for Checkout<'a, S>
where S: Freeze,

§

impl<'a, S> RefUnwindSafe for Checkout<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for Checkout<'a, S>
where S: Send,

§

impl<'a, S> Sync for Checkout<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for Checkout<'a, S>
where S: Unpin,

§

impl<'a, S> UnsafeUnpin for Checkout<'a, S>
where S: UnsafeUnpin,

§

impl<'a, S> UnwindSafe for Checkout<'a, S>
where S: UnwindSafe,

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

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.