pub struct TaskId(/* private fields */);Expand description
SHA-256 hash of a task’s user-facing name (e.g. "validate").
Stored on every runtime data structure that previously held a task
id as a String — ExecutionPosition
variants, TaskResult, the
completed_tasks/task_retries/loop_iterations HashMap keys on
WorkflowSnapshot,
AvailableTask, and so on. The
human-readable name only lives once per workflow definition on the
continuation tree.
32-byte memcmp + single-u64 hash, same wins as DefinitionHash.
Implementations§
Source§impl TaskId
impl TaskId
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Construct a TaskId from raw 32 bytes.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, Hash32ParseError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, Hash32ParseError>
Construct a TaskId from a length-checked byte slice. See Hash32::from_slice.
§Errors
Returns Hash32ParseError::WrongLength if bytes.len() != 32.
Sourcepub fn sha256(input: impl AsRef<[u8]>) -> Self
pub fn sha256(input: impl AsRef<[u8]>) -> Self
SHA-256-hash the given input and wrap the result.
This is the canonical way to mint a fresh id from a human-readable name at construction time.