pub struct ItemId { /* private fields */ }Expand description
PBI stable identifier (<PREFIX>-<NUMBER>, e.g. T-1).
Implementations§
Source§impl ItemId
impl ItemId
Sourcepub fn try_new(prefix: impl Into<String>, number: u32) -> Result<Self>
pub fn try_new(prefix: impl Into<String>, number: u32) -> Result<Self>
Construct an ID from a validated prefix and number.
Prefixes are ASCII letters only. Use this fallible constructor at public boundaries; the crate-private constructor below is reserved for known-safe fixtures and values produced by already-validated domain data.
§Examples
use pinto::backlog::ItemId;
let id = ItemId::try_new("T", 42).expect("safe prefix");
assert_eq!(id.prefix(), "T");
assert_eq!(id.number(), 42);
assert_eq!(id.to_string(), "T-42");Trait Implementations§
impl Eq for ItemId
impl StructuralPartialEq for ItemId
Auto Trait Implementations§
impl Freeze for ItemId
impl RefUnwindSafe for ItemId
impl Send for ItemId
impl Sync for ItemId
impl Unpin for ItemId
impl UnsafeUnpin for ItemId
impl UnwindSafe for ItemId
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more