pub mod attention;
pub mod authority;
pub mod calls;
pub mod live;
pub mod work;
pub type Result<T> = std::result::Result<T, String>;
pub const MAX_TEXT_BYTES: usize = 16 * 1024;
pub const MAX_ITEMS: usize = 256;
pub const MAX_SNAPSHOT_BYTES: usize = 1024 * 1024;
fn text(value: &str) -> Result<()> {
if value.trim().is_empty() || value.len() > MAX_TEXT_BYTES {
return Err("text must be nonempty and at most 16384 bytes".into());
}
Ok(())
}
fn next(value: u64) -> Result<u64> {
value
.checked_add(1)
.ok_or_else(|| "generation exhausted".into())
}
#[cfg(test)]
mod tests;