pub struct BoundedCaveats<'a>(/* private fields */);Expand description
Validated sequence of fixed-size caveat records.
The raw slice must satisfy:
len % CAVEAT_SIZE == 0len <= CAVEAT_SIZE * MAX_CAVEATS- every tag byte is
0x01(not_before) or0x02(not_after)
An empty slice (no caveats) is accepted.
Implementations§
Source§impl<'a> BoundedCaveats<'a>
impl<'a> BoundedCaveats<'a>
Sourcepub fn try_new(raw: &'a [u8]) -> Result<Self, KernelError>
pub fn try_new(raw: &'a [u8]) -> Result<Self, KernelError>
Parses and validates a raw caveat slice.
Returns CaveatsTooLarge if the slice exceeds the maximum total size,
MalformedCaveatBuffer if the length is not a multiple of CAVEAT_SIZE
or any tag byte is unrecognized.
Trait Implementations§
Source§impl<'a> Clone for BoundedCaveats<'a>
impl<'a> Clone for BoundedCaveats<'a>
Source§fn clone(&self) -> BoundedCaveats<'a>
fn clone(&self) -> BoundedCaveats<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for BoundedCaveats<'a>
impl<'a> Debug for BoundedCaveats<'a>
Source§impl<'a> PartialEq for BoundedCaveats<'a>
impl<'a> PartialEq for BoundedCaveats<'a>
impl<'a> Copy for BoundedCaveats<'a>
impl<'a> Eq for BoundedCaveats<'a>
impl<'a> StructuralPartialEq for BoundedCaveats<'a>
Auto Trait Implementations§
impl<'a> Freeze for BoundedCaveats<'a>
impl<'a> RefUnwindSafe for BoundedCaveats<'a>
impl<'a> Send for BoundedCaveats<'a>
impl<'a> Sync for BoundedCaveats<'a>
impl<'a> Unpin for BoundedCaveats<'a>
impl<'a> UnsafeUnpin for BoundedCaveats<'a>
impl<'a> UnwindSafe for BoundedCaveats<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more