pub struct User<'a>(pub Cow<'a, str>);
Expand description
Represents “who” a given branch belongs to. This value should be shared by multiple git clones that belong to the same user.
This string is used when pushing branches to the remote so that multiple users can use nomad on that remote without overwriting each others refs.
Tuple Fields§
§0: Cow<'a, str>
Implementations§
source§impl User<'_>
impl User<'_>
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) -> User<'static>
source§impl<'a> User<'a>
impl<'a> User<'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§
impl<'a> Eq for User<'a>
impl<'a> StructuralPartialEq for User<'a>
Auto Trait Implementations§
impl<'a> Freeze for User<'a>
impl<'a> RefUnwindSafe for User<'a>
impl<'a> Send for User<'a>
impl<'a> Sync for User<'a>
impl<'a> Unpin for User<'a>
impl<'a> UnwindSafe for User<'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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)