This starts to “feel right” when it comes to “zerocopy”:
pub trait TpmCast<'a>: Sized {
fn cast(slice: &'a [u8]) -> TpmResult<Self>;
fn as_slice(&self) -> &'a [u8];
}
And pretty analogus to pre-existing TpmBuild and TpmParse i.e., they provide clone semantics and this is like hierarchical pointer.
It’s pretty easy to squeeze in because I only really have to edit macros for the most part. I have already basic types, and buffers and lists will follow the same patterns.