Struct git_nomad::types::NomadRef

source ·
pub struct NomadRef<'a, Ref> {
    pub user: User<'a>,
    pub host: Host<'a>,
    pub branch: Branch<'a>,
    pub ref_: Ref,
}
Expand description

A ref representing a branch managed by nomad.

Fields§

§user: User<'a>

The user this branch belongs to.

§host: Host<'a>

The host this branch comes from.

§branch: Branch<'a>

The branch name.

§ref_: Ref

Any additional internal data representing the underlying git ref.

Implementations§

source§

impl<Ref> NomadRef<'_, Ref>

source

pub fn to_git_remote_ref(&self) -> String

A nomad ref in the remote. The remote may have many users that all use git-nomad and so shouldn’t step on each others toes.

source§

impl NomadRef<'_, GitRef>

source

pub fn from_git_local_ref<'a>( user: &'a User<'_>, git_ref: GitRef, ) -> Result<NomadRef<'a, GitRef>, GitRef>

Constructs a NomadRef from a git ref in the local clone, which elides the user name for convenience.

source

pub fn from_git_remote_ref( git_ref: GitRef, ) -> Result<NomadRef<'static, GitRef>, GitRef>

Constructs a NomadRef from a git ref in the remote, which includes the user as part of the ref name.

Trait Implementations§

source§

impl<'a, Ref: Debug> Debug for NomadRef<'a, Ref>

source§

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

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

impl<'a, Ref> FromIterator<NomadRef<'a, Ref>> for RemoteNomadRefSet

source§

fn from_iter<T: IntoIterator<Item = NomadRef<'a, Ref>>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<'a, Ref: Hash> Hash for NomadRef<'a, Ref>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, Ref: PartialEq> PartialEq for NomadRef<'a, Ref>

source§

fn eq(&self, other: &NomadRef<'a, Ref>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, Ref: Eq> Eq for NomadRef<'a, Ref>

source§

impl<'a, Ref> StructuralPartialEq for NomadRef<'a, Ref>

Auto Trait Implementations§

§

impl<'a, Ref> Freeze for NomadRef<'a, Ref>
where Ref: Freeze,

§

impl<'a, Ref> RefUnwindSafe for NomadRef<'a, Ref>
where Ref: RefUnwindSafe,

§

impl<'a, Ref> Send for NomadRef<'a, Ref>
where Ref: Send,

§

impl<'a, Ref> Sync for NomadRef<'a, Ref>
where Ref: Sync,

§

impl<'a, Ref> Unpin for NomadRef<'a, Ref>
where Ref: Unpin,

§

impl<'a, Ref> UnwindSafe for NomadRef<'a, Ref>
where Ref: 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.