#[repr(C)]pub struct AuditTag {
pub org_id: u64,
pub engagement_id: u64,
}Expand description
Two-level hierarchy for audit firm workload accounting.
Every K2K MessageEnvelope carries an AuditTag so that GPU work can be
attributed back to a specific engagement — critical for per-engagement
billing and tamper-evident audit trails.
AuditTag::default() returns { org_id: 0, engagement_id: 0 }, denoting
an unspecified / system-level engagement. This is the backward-compatible
default for single-tenant deployments.
§Layout
Pod, Zeroable, AsBytes, FromBytes — safe for direct blit into GPU-shared memory. Rkyv-compatible for zero-copy serialization in message queues.
Fields§
§org_id: u64Audit firm / organization ID.
Stable across all engagements belonging to the same organization.
0 = unspecified (default).
engagement_id: u64Specific engagement / audit project ID.
Distinct per billable unit of work. 0 = unspecified (default).
Implementations§
Source§impl AuditTag
impl AuditTag
Sourcepub const fn unspecified() -> AuditTag
pub const fn unspecified() -> AuditTag
The unspecified / default audit tag ({0, 0}).
Used in single-tenant deployments and as the default for legacy APIs that don’t propagate audit information.
Sourcepub const fn is_unspecified(&self) -> bool
pub const fn is_unspecified(&self) -> bool
Returns true if this tag is the default / unspecified tag ({0, 0}).
Sourcepub fn to_bytes(&self) -> [u8; 16]
pub fn to_bytes(&self) -> [u8; 16]
Returns the raw bytes of this tag (16 bytes, little-endian).
Used when stamping audit tags into wire-format K2K message envelopes.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> AuditTag
pub fn from_bytes(bytes: [u8; 16]) -> AuditTag
Reconstruct an AuditTag from its raw byte representation.
Trait Implementations§
Source§impl Archive for AuditTag
impl Archive for AuditTag
Source§type Archived = ArchivedAuditTag
type Archived = ArchivedAuditTag
Source§type Resolver = AuditTagResolver
type Resolver = AuditTagResolver
Source§impl AsBytes for AuditTag
impl AsBytes for AuditTag
Source§impl FromBytes for AuditTag
impl FromBytes for AuditTag
Source§fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>
fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>
Source§fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>
fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>
Source§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized,
bytes as a &[Self] with length
equal to count without copying. Read moreSource§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized,
bytes as a &[Self] with length
equal to count without copying. Read moreSource§fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>
fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>
Source§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [Self], &mut [u8])>
fn mut_slice_from_prefix( bytes: &mut [u8], count: usize, ) -> Option<(&mut [Self], &mut [u8])>
bytes as a &mut [Self] with length
equal to count without copying. Read moreSource§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize,
) -> Option<(&mut [u8], &mut [Self])>
fn mut_slice_from_suffix( bytes: &mut [u8], count: usize, ) -> Option<(&mut [u8], &mut [Self])>
bytes as a &mut [Self] with length
equal to count without copying. Read moreSource§impl FromZeroes for AuditTagwhere
u64: FromZeroes,
impl FromZeroes for AuditTagwhere
u64: FromZeroes,
impl Copy for AuditTag
impl Eq for AuditTag
impl Pod for AuditTag
impl StructuralPartialEq for AuditTag
Auto Trait Implementations§
impl Freeze for AuditTag
impl RefUnwindSafe for AuditTag
impl Send for AuditTag
impl Sync for AuditTag
impl Unpin for AuditTag
impl UnsafeUnpin for AuditTag
impl UnwindSafe for AuditTag
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more