use super::types::CaptureError;
use crate::identity::encode_bytes;
use crate::token::encode_token_path;
impl CaptureError {
#[must_use]
pub fn canonical_bytes(&self) -> Vec<u8> {
let mut material = vec![self.slot()];
match self {
Self::Unbounded { bound } => encode_bytes(bound.name().as_bytes(), &mut material),
Self::Unread { cause, path, at: _ } => {
encode_bytes(cause.name().as_bytes(), &mut material);
encode_token_path(path, &mut material);
}
}
material
}
}