pub struct PrimitiveId(/* private fields */);Expand description
A primitive’s name, or a resource’s URI.
One newtype for all four kinds rather than a ToolId, a ResourceId and so
on, because they are looked up in one namespace-shaped map per kind and
nothing in the registry ever compares a tool’s name against a prompt’s. Four
newtypes would mean four identical HashMap key types and a conversion at
every boundary, and would buy nothing: a ToolId cannot be passed where a
prompt is expected, but neither can an Arc<str> that was obtained from a
different table.
Arc<str> and deliberately not Copy, for the same reason
RequestId is: duplicating an identifier is
meaningless, and a clone that shares the same bytes is the point.
Implementations§
Trait Implementations§
Source§impl Clone for PrimitiveId
impl Clone for PrimitiveId
Source§impl Debug for PrimitiveId
impl Debug for PrimitiveId
Source§impl Display for PrimitiveId
impl Display for PrimitiveId
impl Eq for PrimitiveId
Source§impl From<&str> for PrimitiveId
impl From<&str> for PrimitiveId
Source§impl From<String> for PrimitiveId
impl From<String> for PrimitiveId
Source§impl Hash for PrimitiveId
impl Hash for PrimitiveId
Source§impl Ord for PrimitiveId
impl Ord for PrimitiveId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for PrimitiveId
impl PartialEq for PrimitiveId
Source§impl PartialOrd for PrimitiveId
impl PartialOrd for PrimitiveId
impl StructuralPartialEq for PrimitiveId
Auto Trait Implementations§
impl Freeze for PrimitiveId
impl RefUnwindSafe for PrimitiveId
impl Send for PrimitiveId
impl Sync for PrimitiveId
impl Unpin for PrimitiveId
impl UnsafeUnpin for PrimitiveId
impl UnwindSafe for PrimitiveId
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