pub enum NameOrId<'a> {
Name(Cow<'a, str>),
Id(u64),
}Expand description
A strucutre for storing a name or ID where either is allowed.
Variants§
Name(Cow<'a, str>)
The name of the entity.
Note that numeric names are ambiguous to GitLab. There is nothing done with this crate which attempts to resolve this ambiguity.
Id(u64)
The ID of the entity.
Trait Implementations§
source§impl<'a> ParamValue<'a> for &'a NameOrId<'a>
impl<'a> ParamValue<'a> for &'a NameOrId<'a>
source§impl<'a> ParamValue<'a> for NameOrId<'a>
impl<'a> ParamValue<'a> for NameOrId<'a>
source§impl<'a> PartialEq<NameOrId<'a>> for NameOrId<'a>
impl<'a> PartialEq<NameOrId<'a>> for NameOrId<'a>
impl<'a> Eq for NameOrId<'a>
impl<'a> StructuralEq for NameOrId<'a>
impl<'a> StructuralPartialEq for NameOrId<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for NameOrId<'a>
impl<'a> Send for NameOrId<'a>
impl<'a> Sync for NameOrId<'a>
impl<'a> Unpin for NameOrId<'a>
impl<'a> UnwindSafe for NameOrId<'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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.