pub struct Host<'a>(pub Cow<'a, str>);
Expand description
Represents “where” a given branch comes from. This value should be unique for every git clone belonging to a specific user.
This string is used when pushing branches to the remote so that multiple hosts belonging to the same user can co-exist (i.e. the whole point of nomad).
This string is also used when pulling branches for all hosts of the current user and for detecting when branches have been deleted.
Tuple Fields§
§0: Cow<'a, str>
Implementations§
source§impl Host<'_>
impl Host<'_>
Takes ownership of non-'static
borrowed data, possibly allocating a
String
to do so.
Convenient representation for types that want to stake ownership of the newtype without exposing a generic lifetime of their own.
pub fn possibly_clone(self) -> Host<'static>
source§impl<'a> Host<'a>
impl<'a> Host<'a>
Returns a copy of itself while guaranteeing zero allocations.
Useful for standard containers that use the Borrow + Hash + Eq
sleight of hand to
permit zero allocation lookups while still owning the underlying data.
pub fn always_borrow(&'a self) -> Self
Trait Implementations§
source§impl<'a> Ord for Host<'a>
impl<'a> Ord for Host<'a>
source§impl<'a> PartialOrd for Host<'a>
impl<'a> PartialOrd for Host<'a>
impl<'a> Eq for Host<'a>
impl<'a> StructuralPartialEq for Host<'a>
Auto Trait Implementations§
impl<'a> Freeze for Host<'a>
impl<'a> RefUnwindSafe for Host<'a>
impl<'a> Send for Host<'a>
impl<'a> Sync for Host<'a>
impl<'a> Unpin for Host<'a>
impl<'a> UnwindSafe for Host<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)