pub struct Id(pub String);Expand description
Stable identity for tasks, actors, collections. Opaque string (a random ULID in real adapters; a sequence in tests). Serializes transparently as that string.
Tuple Fields§
§0: StringImplementations§
Source§impl Id
impl Id
pub fn new(s: impl Into<String>) -> Self
pub fn as_str(&self) -> &str
Sourcepub fn root() -> Self
pub fn root() -> Self
The invisible structural root (spec §7 virtual-root sentinel). Never a
task entity — only ever a child link from. The reserved string
can’t collide with a 26-char base32 ULID.
pub fn is_root(&self) -> bool
Sourcepub fn for_blob(bytes: &[u8]) -> Self
pub fn for_blob(bytes: &[u8]) -> Self
Content-addressed id for a blob: same bytes ⇒ same id (cheap incidental
dedup, not a content-hash identity guarantee — collisions are possible
but not a practical concern at this scale). Shared by every BlobStore
adapter so they agree on ids for the same bytes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Id
Source§impl Ord for Id
impl Ord for Id
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
Source§impl PartialOrd for Id
impl PartialOrd for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnsafeUnpin for Id
impl UnwindSafe for Id
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