42 lines
1.3 KiB
Rust
42 lines
1.3 KiB
Rust
//! Small stable identity types shared across workspace layers.
|
|
|
|
use std::fmt;
|
|
|
|
mod diagnostic;
|
|
mod execution;
|
|
mod log;
|
|
mod value;
|
|
pub use diagnostic::{DiagnosticSeverity, SourceDiagnostic, SourcePosition, SourceRange};
|
|
pub use execution::{
|
|
DebugStopReason, DebuggerSnapshot, ExecutionInspection, SourceBreakpoint, StackFrame,
|
|
StackFrameKind, StepMode,
|
|
};
|
|
pub use log::{LogEntry, LogLevel};
|
|
pub use value::{ActorRef, MAX_VALUE_BYTES, MAX_VALUE_DEPTH, MAX_VALUE_NODES, Value};
|
|
|
|
macro_rules! digest_id {
|
|
($name:ident, $prefix:literal) => {
|
|
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
|
pub struct $name(pub [u8; 32]);
|
|
|
|
impl fmt::Debug for $name {
|
|
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(formatter, "{}", self)
|
|
}
|
|
}
|
|
|
|
impl fmt::Display for $name {
|
|
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(formatter, concat!($prefix, ":blake3:"))?;
|
|
for byte in self.0 {
|
|
write!(formatter, "{byte:02x}")?;
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
digest_id!(SourceId, "runa-source:v1");
|
|
digest_id!(ImplementationId, "runa-implementation:v1");
|